Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
dsinclair | 038bf0b | 2016-04-30 06:00:05 -0700 | [diff] [blame] | 5 | import("../../pdfium.gni") |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 6 | |
| 7 | config("libfuzzer_config") { |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 8 | configs = [ "../..:pdfium_core_config" ] |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 9 | |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 10 | defines = [ |
| 11 | "PNG_PREFIX", |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 12 | "PNG_USE_READ_MACROS", |
| 13 | ] |
| 14 | include_dirs = [ "../.." ] |
| 15 | if (pdf_enable_v8) { |
| 16 | defines += [ "PDF_ENABLE_V8" ] |
| 17 | } |
| 18 | if (pdf_enable_xfa) { |
| 19 | defines += [ "PDF_ENABLE_XFA" ] |
| 20 | } |
| 21 | } |
| 22 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 23 | group("libfuzzer") { |
Lei Zhang | 0acfff3 | 2017-05-02 16:40:04 -0700 | [diff] [blame^] | 24 | testonly = true |
| 25 | deps = [ |
| 26 | ":pdf_cmap_fuzzer", |
| 27 | ":pdf_codec_a85_fuzzer", |
| 28 | ":pdf_codec_fax_fuzzer", |
| 29 | ":pdf_codec_icc_fuzzer", |
| 30 | ":pdf_codec_jbig2_fuzzer", |
| 31 | ":pdf_codec_rle_fuzzer", |
| 32 | ":pdf_hint_table_fuzzer", |
| 33 | ":pdf_jpx_fuzzer", |
| 34 | ":pdf_psengine_fuzzer", |
| 35 | ":pdf_streamparser_fuzzer", |
| 36 | ] |
| 37 | if (pdf_enable_xfa) { |
| 38 | deps += [ |
| 39 | ":pdf_cfx_barcode_fuzzer", |
| 40 | ":pdf_cfx_saxreader_fuzzer", |
| 41 | ":pdf_codec_bmp_fuzzer", |
| 42 | ":pdf_codec_gif_fuzzer", |
| 43 | ":pdf_codec_jpeg_fuzzer", |
| 44 | ":pdf_codec_png_fuzzer", |
| 45 | ":pdf_codec_tiff_fuzzer", |
| 46 | ":pdf_css_fuzzer", |
| 47 | ":pdf_fm2js_fuzzer", |
| 48 | ":pdf_xml_fuzzer", |
| 49 | ] |
| 50 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | template("pdfium_fuzzer") { |
| 54 | source_set(target_name) { |
Dan Sinclair | 8149ae1 | 2017-03-28 12:40:20 -0400 | [diff] [blame] | 55 | sources = invoker.sources + [ "pdf_fuzzer_init.cc" ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 56 | deps = [ |
| 57 | "../..:pdfium", |
| 58 | ] |
| 59 | testonly = true |
| 60 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 61 | configs += [ |
| 62 | "//build/config/compiler:no_chromium_code", |
| 63 | ":libfuzzer_config", |
| 64 | ] |
| 65 | } |
| 66 | } |
| 67 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 68 | if (pdf_enable_xfa) { |
Tom Sepez | 5628fd7 | 2017-04-27 14:58:53 -0700 | [diff] [blame] | 69 | pdfium_fuzzer("pdf_cfx_barcode_fuzzer") { |
| 70 | sources = [ |
| 71 | "pdf_cfx_barcode_fuzzer.cc", |
| 72 | ] |
| 73 | } |
| 74 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 75 | pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 76 | sources = [ |
| 77 | "pdf_cfx_saxreader_fuzzer.cc", |
| 78 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 79 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 80 | |
| 81 | pdfium_fuzzer("pdf_codec_bmp_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 82 | sources = [ |
| 83 | "pdf_codec_bmp_fuzzer.cc", |
| 84 | "xfa_codec_fuzzer.h", |
| 85 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | pdfium_fuzzer("pdf_codec_gif_fuzzer") { |
| 89 | sources = [ |
| 90 | "pdf_codec_gif_fuzzer.cc", |
| 91 | "xfa_codec_fuzzer.h", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 92 | ] |
| 93 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 94 | |
| 95 | pdfium_fuzzer("pdf_codec_jpeg_fuzzer") { |
| 96 | sources = [ |
| 97 | "pdf_codec_jpeg_fuzzer.cc", |
| 98 | "xfa_codec_fuzzer.h", |
| 99 | ] |
| 100 | } |
| 101 | |
| 102 | pdfium_fuzzer("pdf_codec_png_fuzzer") { |
| 103 | sources = [ |
| 104 | "pdf_codec_png_fuzzer.cc", |
| 105 | "xfa_codec_fuzzer.h", |
| 106 | ] |
| 107 | } |
| 108 | |
| 109 | pdfium_fuzzer("pdf_codec_tiff_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 110 | sources = [ |
| 111 | "pdf_codec_tiff_fuzzer.cc", |
| 112 | "xfa_codec_fuzzer.h", |
| 113 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 114 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 115 | |
| 116 | pdfium_fuzzer("pdf_css_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 117 | sources = [ |
| 118 | "pdf_css_fuzzer.cc", |
| 119 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | pdfium_fuzzer("pdf_fm2js_fuzzer") { |
| 123 | sources = [ |
| 124 | "pdf_fm2js_fuzzer.cc", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 125 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | pdfium_fuzzer("pdf_xml_fuzzer") { |
| 129 | sources = [ |
| 130 | "pdf_xml_fuzzer.cc", |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 131 | ] |
| 132 | } |
| 133 | } |
| 134 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 135 | pdfium_fuzzer("pdf_cmap_fuzzer") { |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 136 | sources = [ |
| 137 | "pdf_cmap_fuzzer.cc", |
| 138 | ] |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 139 | } |
| 140 | |
rbpotter | db76470 | 2017-01-12 10:31:43 -0800 | [diff] [blame] | 141 | pdfium_fuzzer("pdf_codec_a85_fuzzer") { |
| 142 | sources = [ |
| 143 | "pdf_codec_a85_fuzzer.cc", |
| 144 | ] |
| 145 | } |
| 146 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 147 | pdfium_fuzzer("pdf_codec_fax_fuzzer") { |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 148 | sources = [ |
| 149 | "pdf_codec_fax_fuzzer.cc", |
| 150 | ] |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 151 | } |
| 152 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 153 | pdfium_fuzzer("pdf_codec_icc_fuzzer") { |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 154 | sources = [ |
| 155 | "pdf_codec_icc_fuzzer.cc", |
| 156 | ] |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 157 | } |
| 158 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 159 | pdfium_fuzzer("pdf_codec_jbig2_fuzzer") { |
kcwu | ec7a945 | 2016-09-27 14:06:50 -0700 | [diff] [blame] | 160 | sources = [ |
| 161 | "pdf_codec_jbig2_fuzzer.cc", |
| 162 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 163 | } |
| 164 | |
rbpotter | db76470 | 2017-01-12 10:31:43 -0800 | [diff] [blame] | 165 | pdfium_fuzzer("pdf_codec_rle_fuzzer") { |
| 166 | sources = [ |
| 167 | "pdf_codec_rle_fuzzer.cc", |
| 168 | ] |
| 169 | } |
| 170 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 171 | pdfium_fuzzer("pdf_hint_table_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 172 | sources = [ |
| 173 | "pdf_hint_table_fuzzer.cc", |
| 174 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | pdfium_fuzzer("pdf_jpx_fuzzer") { |
| 178 | sources = [ |
| 179 | "pdf_jpx_fuzzer.cc", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 180 | ] |
| 181 | } |
| 182 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 183 | pdfium_fuzzer("pdf_psengine_fuzzer") { |
| 184 | sources = [ |
| 185 | "pdf_psengine_fuzzer.cc", |
| 186 | ] |
| 187 | } |
| 188 | |
| 189 | pdfium_fuzzer("pdf_streamparser_fuzzer") { |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 190 | sources = [ |
| 191 | "pdf_streamparser_fuzzer.cc", |
| 192 | ] |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 193 | } |