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

Side by Side Diff: testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc

Issue 2535723010: Rename IFX_Stream to IFGAS_Stream. (Closed)
Patch Set: rename more to IFGAS, {} 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser_unittest.cpp ('k') | testing/libfuzzer/pdf_css_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The PDFium Authors. All rights reserved. 1 // Copyright 2016 The PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 6
7 #include "xfa/fde/xml/cfx_saxreader.h" 7 #include "xfa/fde/xml/cfx_saxreader.h"
8 #include "xfa/fgas/crt/fgas_stream.h" 8 #include "xfa/fgas/crt/fgas_stream.h"
9 #include "xfa/fxfa/parser/cxfa_widetextread.h" 9 #include "xfa/fxfa/parser/cxfa_widetextread.h"
10 10
11 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 11 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
12 CFX_WideString input = CFX_WideString::FromUTF8( 12 CFX_WideString input = CFX_WideString::FromUTF8(
13 CFX_ByteStringC(data, static_cast<FX_STRSIZE>(size))); 13 CFX_ByteStringC(data, static_cast<FX_STRSIZE>(size)));
14 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> stream( 14 std::unique_ptr<IFGAS_Stream, ReleaseDeleter<IFGAS_Stream>> stream(
15 new CXFA_WideTextRead(input)); 15 new CXFA_WideTextRead(input));
16 if (!stream) 16 if (!stream)
17 return 0; 17 return 0;
18 18
19 std::unique_ptr<IFX_SeekableReadStream, 19 std::unique_ptr<IFX_SeekableReadStream,
20 ReleaseDeleter<IFX_SeekableReadStream>> 20 ReleaseDeleter<IFX_SeekableReadStream>>
21 fileRead(stream->MakeSeekableReadStream()); 21 fileRead(stream->MakeSeekableReadStream());
22 if (!fileRead) 22 if (!fileRead)
23 return 0; 23 return 0;
24 24
25 CFX_SAXReader reader; 25 CFX_SAXReader reader;
26 if (reader.StartParse(fileRead.get(), 0, -1, CFX_SaxParseMode_NotSkipSpace) < 26 if (reader.StartParse(fileRead.get(), 0, -1, CFX_SaxParseMode_NotSkipSpace) <
27 0) { 27 0) {
28 return 0; 28 return 0;
29 } 29 }
30 30
31 while (1) { 31 while (1) {
32 int32_t ret = reader.ContinueParse(nullptr); 32 int32_t ret = reader.ContinueParse(nullptr);
33 if (ret < 0 || ret > 99) 33 if (ret < 0 || ret > 99)
34 break; 34 break;
35 } 35 }
36 36
37 return 0; 37 return 0;
38 } 38 }
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser_unittest.cpp ('k') | testing/libfuzzer/pdf_css_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698