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

Side by Side Diff: pdf/pdfium/fuzzers/pdfium_xfa_fuzzer.cc

Issue 2754103002: Add XFA pdfium fuzzer (Closed)
Patch Set: seed corpus Created 3 years, 9 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 | « pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h"
6
7 class PDFiumXFAFuzzer : public PDFiumFuzzerHelper {
8 public:
9 PDFiumXFAFuzzer() : PDFiumFuzzerHelper() {}
10 ~PDFiumXFAFuzzer() override {}
11
12 int GetFormCallbackVersion() const override { return 2; }
13
14 // Return false if XFA doesn't load as otherwise we're duplicating the work
15 // done by the non-xfa fuzzer.
16 bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc) override {
17 int doc_type = DOCTYPE_PDF;
18 if (!FPDF_HasXFAField(doc, &doc_type) || doc_type == DOCTYPE_PDF)
19 return false;
20 return FPDF_LoadXFA(doc);
21 }
22 };
23
24 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
25 PDFiumXFAFuzzer fuzzer;
26 fuzzer.RenderPdf(reinterpret_cast<const char*>(data), size);
27 return 0;
28 }
OLDNEW
« no previous file with comments | « pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698