diff options
author | tsepez <tsepez@chromium.org> | 2016-12-07 19:01:56 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-07 19:01:56 -0800 |
commit | 64f4e25304dfd93651ac5c9d5379ed2fffbb993f (patch) | |
tree | 67f755611451432631bd27c494236b8b6ee418b4 /testing/libfuzzer/pdf_xml_fuzzer.cc | |
parent | 1306b180a6a8e306a7d00db9cdaa983784c354ed (diff) | |
download | pdfium-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/libfuzzer/pdf_xml_fuzzer.cc')
-rw-r--r-- | testing/libfuzzer/pdf_xml_fuzzer.cc | 9 |
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()); |