summaryrefslogtreecommitdiff
path: root/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 09:21:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 09:21:18 -0800
commit833619b4441915c7c55085d44b3221eaef0d9800 (patch)
tree68bf76e83078223ba03f490c2c13f484e40154d4 /testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
parent8f875507a986d10335e40a5f7c1679aff9770d0a (diff)
downloadpdfium-833619b4441915c7c55085d44b3221eaef0d9800.tar.xz
Refcount all the IFX_ stream classes all the time.
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
Diffstat (limited to 'testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc')
-rw-r--r--testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
index 63d0e3c75d..94decbfc2c 100644
--- a/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
+++ b/testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc
@@ -16,17 +16,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (!stream)
return 0;
- std::unique_ptr<IFX_SeekableReadStream,
- ReleaseDeleter<IFX_SeekableReadStream>>
- fileRead(stream->MakeSeekableReadStream());
+ CFX_RetainPtr<IFX_SeekableReadStream> fileRead =
+ stream->MakeSeekableReadStream();
if (!fileRead)
return 0;
CFX_SAXReader reader;
- if (reader.StartParse(fileRead.get(), 0, -1, CFX_SaxParseMode_NotSkipSpace) <
- 0) {
+ if (reader.StartParse(fileRead, 0, -1, CFX_SaxParseMode_NotSkipSpace) < 0)
return 0;
- }
while (1) {
int32_t ret = reader.ContinueParse(nullptr);