Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1139)

Unified Diff: testing/libfuzzer/pdf_xml_fuzzer.cc

Issue 2559763002: Refcount IFGAS_ streams all the time, too (Closed)
Patch Set: more Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/pdf_css_fuzzer.cc ('k') | xfa/fde/cfde_txtedtengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/pdf_xml_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc
index d28522c2ea8b620b476d0012d68f809ed5e5e321..4f000ab78e8b6cf8385560767d97ea52ced77eb6 100644
--- a/testing/libfuzzer/pdf_xml_fuzzer.cc
+++ b/testing/libfuzzer/pdf_xml_fuzzer.cc
@@ -52,15 +52,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
CFX_WideString input =
CFX_WideString::FromUTF8(CFX_ByteStringC(data, safe_size.ValueOrDie()));
- std::unique_ptr<IFGAS_Stream, ReleaseDeleter<IFGAS_Stream>> stream(
- new CXFA_WideTextRead(input));
+ auto stream = pdfium::MakeRetain<CXFA_WideTextRead>(input);
if (!stream)
return 0;
std::unique_ptr<CFDE_XMLDoc> doc = pdfium::MakeUnique<CFDE_XMLDoc>();
std::unique_ptr<CFDE_XMLParser, ReleaseDeleter<CFDE_XMLParser>> parser(
- new CXFA_XMLParser(doc->GetRoot(), stream.get()));
-
+ new CXFA_XMLParser(doc->GetRoot(), stream));
if (!doc->LoadXML(parser.release()))
return 0;
« no previous file with comments | « testing/libfuzzer/pdf_css_fuzzer.cc ('k') | xfa/fde/cfde_txtedtengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698