summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 19:01:56 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 19:01:56 -0800
commit64f4e25304dfd93651ac5c9d5379ed2fffbb993f (patch)
tree67f755611451432631bd27c494236b8b6ee418b4 /testing
parent1306b180a6a8e306a7d00db9cdaa983784c354ed (diff)
downloadpdfium-64f4e25304dfd93651ac5c9d5379ed2fffbb993f.tar.xz
Use unique_ptr for CXFA_XMLParser.
Also rename CFDE_XMLParser to IFDE_XMLParser since its an interface. Review-Url: https://codereview.chromium.org/2555373002
Diffstat (limited to 'testing')
-rw-r--r--testing/libfuzzer/pdf_xml_fuzzer.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc
index 4f000ab78e..e3cd254344 100644
--- a/testing/libfuzzer/pdf_xml_fuzzer.cc
+++ b/testing/libfuzzer/pdf_xml_fuzzer.cc
@@ -56,14 +56,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
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));
- if (!doc->LoadXML(parser.release()))
+ auto doc = pdfium::MakeUnique<CFDE_XMLDoc>();
+ if (!doc->LoadXML(pdfium::MakeUnique<CXFA_XMLParser>(doc->GetRoot(), stream)))
return 0;
- int32_t load_result = doc->DoLoad(nullptr);
- if (load_result < 100)
+ if (doc->DoLoad(nullptr) < 100)
return 0;
(void)XFA_FDEExtension_GetDocumentNode(doc.get());