diff --git a/projects/xpdf/fuzz_pdfload.cc b/projects/xpdf/fuzz_pdfload.cc index 92ad5d064..dbdbf4178 100644 --- a/projects/xpdf/fuzz_pdfload.cc +++ b/projects/xpdf/fuzz_pdfload.cc @@ -120,10 +120,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) Object globals; BaseStream *base_str = doc.getBaseStream(); - JBIG2Stream *str = new JBIG2Stream(base_str, &globals); - str->reset(); - globals.free(); - delete str; + if (base_str) { + JBIG2Stream *str = new JBIG2Stream(base_str, &globals); + str->reset(); + delete str; + } + globals.free(); } } catch (...) {