• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The PDFium 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 <string.h>
6 
7 #include "public/fpdfview.h"
8 
9 // Initialize the library once for all runs of the fuzzer.
10 struct TestCase {
TestCaseTestCase11   TestCase() {
12     memset(&config, '\0', sizeof(config));
13     config.version = 2;
14     config.m_pUserFontPaths = nullptr;
15     config.m_pIsolate = nullptr;
16     config.m_v8EmbedderSlot = 0;
17     FPDF_InitLibraryWithConfig(&config);
18   }
19   FPDF_LIBRARY_CONFIG config;
20 };
21 
22 // pdf_fuzzer_init.cc and pdfium_fuzzer_init_public.cc are mutually exclusive
23 // and should not be built together. They deliberately have the same global
24 // variable.
25 static TestCase* g_test_case = new TestCase();
26