From 7cda31ac2f2884166f044937619478a6103198cf Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Dec 2016 12:10:20 -0800 Subject: Refcount IFGAS_ streams all the time, too IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002 --- testing/libfuzzer/pdf_css_fuzzer.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'testing/libfuzzer/pdf_css_fuzzer.cc') diff --git a/testing/libfuzzer/pdf_css_fuzzer.cc b/testing/libfuzzer/pdf_css_fuzzer.cc index 96877f40be..247c9b9245 100644 --- a/testing/libfuzzer/pdf_css_fuzzer.cc +++ b/testing/libfuzzer/pdf_css_fuzzer.cc @@ -4,6 +4,7 @@ #include +#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "xfa/fde/css/fde_css.h" #include "xfa/fde/css/fde_csssyntax.h" @@ -11,16 +12,15 @@ #include "xfa/fxfa/parser/cxfa_widetextread.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - CFDE_CSSSyntaxParser parser; - CFX_WideString input = CFX_WideString::FromUTF8( CFX_ByteStringC(data, static_cast(size))); - std::unique_ptr> stream( - new CXFA_WideTextRead(input)); + + auto stream = pdfium::MakeRetain(input); if (!stream) return 0; - parser.Init(stream.get(), 1024); + CFDE_CSSSyntaxParser parser; + parser.Init(stream, 1024); FDE_CSSSYNTAXSTATUS status = parser.DoSyntaxParse(); while (status != FDE_CSSSYNTAXSTATUS_Error && -- cgit v1.2.3