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

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

Issue 2165993002: Move xfa_basic_imp to cxfa_widetextread. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Review feedback Created 4 years, 5 months 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 | « testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc ('k') | testing/libfuzzer/pdf_xml_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 "core/fxcrt/include/fx_string.h" 7 #include "core/fxcrt/include/fx_string.h"
8 #include "xfa/fde/css/fde_css.h" 8 #include "xfa/fde/css/fde_css.h"
9 #include "xfa/fde/css/fde_csssyntax.h" 9 #include "xfa/fde/css/fde_csssyntax.h"
10 #include "xfa/fgas/crt/fgas_stream.h" 10 #include "xfa/fgas/crt/fgas_stream.h"
11 #include "xfa/fxfa/parser/xfa_utils.h" 11 #include "xfa/fxfa/parser/cxfa_widetextread.h"
12 12
13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
14 CFDE_CSSSyntaxParser parser; 14 CFDE_CSSSyntaxParser parser;
15 15
16 CFX_WideString input = CFX_WideString::FromUTF8( 16 CFX_WideString input = CFX_WideString::FromUTF8(
17 CFX_ByteStringC(data, static_cast<FX_STRSIZE>(size))); 17 CFX_ByteStringC(data, static_cast<FX_STRSIZE>(size)));
18 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> stream( 18 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> stream(
19 XFA_CreateWideTextRead(input)); 19 new CXFA_WideTextRead(input));
20 if (!stream) 20 if (!stream)
21 return 0; 21 return 0;
22 22
23 parser.Init(stream.get(), 1024); 23 parser.Init(stream.get(), 1024);
24 24
25 FDE_CSSSYNTAXSTATUS status = parser.DoSyntaxParse(); 25 FDE_CSSSYNTAXSTATUS status = parser.DoSyntaxParse();
26 while (status != FDE_CSSSYNTAXSTATUS_Error && 26 while (status != FDE_CSSSYNTAXSTATUS_Error &&
27 status != FDE_CSSSYNTAXSTATUS_EOS) 27 status != FDE_CSSSYNTAXSTATUS_EOS)
28 status = parser.DoSyntaxParse(); 28 status = parser.DoSyntaxParse();
29 29
30 return 0; 30 return 0;
31 } 31 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/pdf_cfx_saxreader_fuzzer.cc ('k') | testing/libfuzzer/pdf_xml_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698