From b4dcddf1ee6b8fc10b1527ab8bcbfebe013bc6fe Mon Sep 17 00:00:00 2001 From: Navidem Date: Tue, 29 Mar 2022 19:14:32 -0700 Subject: [PATCH] Check for non-null baseStream (#7476) --- projects/xpdf/fuzz_pdfload.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 (...) {