From 9d6a2089c93c94461289b21a29771039eace95e7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 12 Apr 2017 11:32:32 -0400 Subject: Remove MakeSeekableReadStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl removes the MakeSeekableReadStream call and, at the one place it's used, creates an IFX_MemoryStream which is a seekable read stream. Change-Id: I6b0b23636eff47f8caca5432313ba99703e21e4d Reviewed-on: https://pdfium-review.googlesource.com/4037 Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'testing') diff --git a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc index 00b55cdbd4..0dfbbdf639 100644 --- a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc +++ b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc @@ -10,20 +10,12 @@ #include "xfa/fxfa/parser/cxfa_widetextread.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - CFX_WideString input = CFX_WideString::FromUTF8( - CFX_ByteStringC(data, static_cast(size))); - auto stream = pdfium::MakeRetain(input); - if (!stream) - return 0; - - CFX_RetainPtr fileRead = - stream->MakeSeekableReadStream(); - if (!fileRead) - return 0; - CFX_SAXReader reader; - if (reader.StartParse(fileRead, 0, -1, CFX_SaxParseMode_NotSkipSpace) < 0) + if (reader.StartParse( + IFX_MemoryStream::Create(const_cast(data), size), 0, -1, + CFX_SaxParseMode_NotSkipSpace) < 0) { return 0; + } while (1) { int32_t ret = reader.ContinueParse(nullptr); -- cgit v1.2.3