summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc b/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc
index d23e3e07fa..9378141ffa 100644
--- a/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc
+++ b/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc
@@ -33,14 +33,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
auto stream = pdfium::MakeUnique<CPDF_Stream>();
stream->AsStream()->SetData(data, size);
- CPDF_StreamAcc src_stream;
- src_stream.LoadAllData(stream->AsStream(), true);
+
+ auto src_stream = pdfium::MakeRetain<CPDF_StreamAcc>(stream->AsStream());
+ src_stream->LoadAllData(true);
CCodec_Jbig2Module module;
CCodec_Jbig2Context jbig2_context;
std::unique_ptr<JBig2_DocumentContext> document_context;
FXCODEC_STATUS status = module.StartDecode(
- &jbig2_context, &document_context, width, height, &src_stream, nullptr,
+ &jbig2_context, &document_context, width, height, src_stream, nullptr,
bitmap->GetBuffer(), bitmap->GetPitch(), nullptr);
while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE)