vcl/workben/pdf2fodgfuzzer.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 09e5cf69b30afe46c037aca024b6014d012b0081
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Oct 10 20:29:13 2025 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Oct 10 22:47:42 2025 +0200

    prefer oss-fuzz to favour pdfs that produce output
    
    Change-Id: If5f72286825cdb71ff9983ae81d55cbfc5f8bb8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192183
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/workben/pdf2fodgfuzzer.cxx b/vcl/workben/pdf2fodgfuzzer.cxx
index be304cfeba90..422303138bf8 100644
--- a/vcl/workben/pdf2fodgfuzzer.cxx
+++ b/vcl/workben/pdf2fodgfuzzer.cxx
@@ -26,8 +26,10 @@ extern "C" void* 
com_sun_star_comp_Draw_VisioImportFilter_get_implementation() {
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 {
     SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
-    (void)TestFODGExportPDF(aStream);
-    return 0;
+    bool bPDFLoaded = TestFODGExportPDF(aStream);
+    // if the pdf didn't load then reject so that input will not be added to 
the corpus
+    // we're not interested in input that doesn't go on to exercise the fodg 
export
+    return bPDFLoaded ? 0 : -1;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to