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", |
Nicolas Pena | 2685318 | 2017-05-17 17:10:36 -0400 | [diff] [blame] | 32 | ":pdf_font_fuzzer", |
Lei Zhang | 0acfff3 | 2017-05-02 16:40:04 -0700 | [diff] [blame] | 33 | ":pdf_hint_table_fuzzer", |
| 34 | ":pdf_jpx_fuzzer", |
| 35 | ":pdf_psengine_fuzzer", |
| 36 | ":pdf_streamparser_fuzzer", |
| 37 | ] |
| 38 | if (pdf_enable_xfa) { |
| 39 | deps += [ |
| 40 | ":pdf_cfx_barcode_fuzzer", |
| 41 | ":pdf_cfx_saxreader_fuzzer", |
| 42 | ":pdf_codec_bmp_fuzzer", |
| 43 | ":pdf_codec_gif_fuzzer", |
| 44 | ":pdf_codec_jpeg_fuzzer", |
| 45 | ":pdf_codec_png_fuzzer", |
| 46 | ":pdf_codec_tiff_fuzzer", |
| 47 | ":pdf_css_fuzzer", |
| 48 | ":pdf_fm2js_fuzzer", |
Ryan Harrison | f64a730 | 2017-10-19 16:07:24 -0400 | [diff] [blame^] | 49 | ":pdf_formcalc_fuzzer", |
Ryan Harrison | c136b31 | 2017-10-19 14:37:06 -0400 | [diff] [blame] | 50 | ":pdf_lzw_fuzzer", |
Lei Zhang | 0acfff3 | 2017-05-02 16:40:04 -0700 | [diff] [blame] | 51 | ":pdf_xml_fuzzer", |
| 52 | ] |
| 53 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | template("pdfium_fuzzer") { |
| 57 | source_set(target_name) { |
Dan Sinclair | 8149ae1 | 2017-03-28 12:40:20 -0400 | [diff] [blame] | 58 | sources = invoker.sources + [ "pdf_fuzzer_init.cc" ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 59 | deps = [ |
| 60 | "../..:pdfium", |
| 61 | ] |
Lei Zhang | 61f2f48 | 2017-09-19 15:03:15 -0700 | [diff] [blame] | 62 | if (defined(invoker.deps)) { |
| 63 | deps += invoker.deps |
| 64 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 65 | testonly = true |
| 66 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 67 | configs += [ |
| 68 | "//build/config/compiler:no_chromium_code", |
| 69 | ":libfuzzer_config", |
| 70 | ] |
| 71 | } |
| 72 | } |
| 73 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 74 | if (pdf_enable_xfa) { |
Tom Sepez | 5628fd7 | 2017-04-27 14:58:53 -0700 | [diff] [blame] | 75 | pdfium_fuzzer("pdf_cfx_barcode_fuzzer") { |
| 76 | sources = [ |
| 77 | "pdf_cfx_barcode_fuzzer.cc", |
| 78 | ] |
| 79 | } |
| 80 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 81 | pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 82 | sources = [ |
| 83 | "pdf_cfx_saxreader_fuzzer.cc", |
| 84 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 85 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 86 | |
| 87 | pdfium_fuzzer("pdf_codec_bmp_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 88 | sources = [ |
| 89 | "pdf_codec_bmp_fuzzer.cc", |
| 90 | "xfa_codec_fuzzer.h", |
| 91 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | pdfium_fuzzer("pdf_codec_gif_fuzzer") { |
| 95 | sources = [ |
| 96 | "pdf_codec_gif_fuzzer.cc", |
| 97 | "xfa_codec_fuzzer.h", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 98 | ] |
| 99 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 100 | |
| 101 | pdfium_fuzzer("pdf_codec_jpeg_fuzzer") { |
| 102 | sources = [ |
| 103 | "pdf_codec_jpeg_fuzzer.cc", |
| 104 | "xfa_codec_fuzzer.h", |
| 105 | ] |
| 106 | } |
| 107 | |
| 108 | pdfium_fuzzer("pdf_codec_png_fuzzer") { |
| 109 | sources = [ |
| 110 | "pdf_codec_png_fuzzer.cc", |
| 111 | "xfa_codec_fuzzer.h", |
| 112 | ] |
| 113 | } |
| 114 | |
| 115 | pdfium_fuzzer("pdf_codec_tiff_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 116 | sources = [ |
| 117 | "pdf_codec_tiff_fuzzer.cc", |
| 118 | "xfa_codec_fuzzer.h", |
| 119 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 120 | } |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 121 | |
| 122 | pdfium_fuzzer("pdf_css_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 123 | sources = [ |
| 124 | "pdf_css_fuzzer.cc", |
| 125 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | pdfium_fuzzer("pdf_fm2js_fuzzer") { |
| 129 | sources = [ |
| 130 | "pdf_fm2js_fuzzer.cc", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 131 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 132 | } |
| 133 | |
Ryan Harrison | f64a730 | 2017-10-19 16:07:24 -0400 | [diff] [blame^] | 134 | pdfium_fuzzer("pdf_formcalc_fuzzer") { |
| 135 | sources = [ |
| 136 | "pdf_formcalc_fuzzer.cc", |
| 137 | ] |
| 138 | } |
| 139 | |
Ryan Harrison | c136b31 | 2017-10-19 14:37:06 -0400 | [diff] [blame] | 140 | pdfium_fuzzer("pdf_lzw_fuzzer") { |
| 141 | sources = [ |
| 142 | "pdf_lzw_fuzzer.cc", |
| 143 | ] |
| 144 | } |
| 145 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 146 | pdfium_fuzzer("pdf_xml_fuzzer") { |
| 147 | sources = [ |
| 148 | "pdf_xml_fuzzer.cc", |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 149 | ] |
| 150 | } |
| 151 | } |
| 152 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 153 | pdfium_fuzzer("pdf_cmap_fuzzer") { |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 154 | sources = [ |
| 155 | "pdf_cmap_fuzzer.cc", |
| 156 | ] |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 157 | } |
| 158 | |
rbpotter | db76470 | 2017-01-12 10:31:43 -0800 | [diff] [blame] | 159 | pdfium_fuzzer("pdf_codec_a85_fuzzer") { |
| 160 | sources = [ |
| 161 | "pdf_codec_a85_fuzzer.cc", |
| 162 | ] |
| 163 | } |
| 164 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 165 | pdfium_fuzzer("pdf_codec_fax_fuzzer") { |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 166 | sources = [ |
| 167 | "pdf_codec_fax_fuzzer.cc", |
| 168 | ] |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 169 | } |
| 170 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 171 | pdfium_fuzzer("pdf_codec_icc_fuzzer") { |
Lei Zhang | 61f2f48 | 2017-09-19 15:03:15 -0700 | [diff] [blame] | 172 | deps = [ |
| 173 | "../../third_party/:lcms2", |
| 174 | ] |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 175 | sources = [ |
| 176 | "pdf_codec_icc_fuzzer.cc", |
| 177 | ] |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 178 | } |
| 179 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 180 | pdfium_fuzzer("pdf_codec_jbig2_fuzzer") { |
kcwu | ec7a945 | 2016-09-27 14:06:50 -0700 | [diff] [blame] | 181 | sources = [ |
| 182 | "pdf_codec_jbig2_fuzzer.cc", |
| 183 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 184 | } |
| 185 | |
rbpotter | db76470 | 2017-01-12 10:31:43 -0800 | [diff] [blame] | 186 | pdfium_fuzzer("pdf_codec_rle_fuzzer") { |
| 187 | sources = [ |
| 188 | "pdf_codec_rle_fuzzer.cc", |
| 189 | ] |
| 190 | } |
| 191 | |
Nicolas Pena | 2685318 | 2017-05-17 17:10:36 -0400 | [diff] [blame] | 192 | pdfium_fuzzer("pdf_font_fuzzer") { |
| 193 | sources = [ |
| 194 | "pdf_font_fuzzer.cc", |
| 195 | ] |
| 196 | } |
| 197 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 198 | pdfium_fuzzer("pdf_hint_table_fuzzer") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 199 | sources = [ |
| 200 | "pdf_hint_table_fuzzer.cc", |
| 201 | ] |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | pdfium_fuzzer("pdf_jpx_fuzzer") { |
| 205 | sources = [ |
| 206 | "pdf_jpx_fuzzer.cc", |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame] | 207 | ] |
| 208 | } |
| 209 | |
thestig | 62114cf | 2016-11-08 12:59:30 -0800 | [diff] [blame] | 210 | pdfium_fuzzer("pdf_psengine_fuzzer") { |
| 211 | sources = [ |
| 212 | "pdf_psengine_fuzzer.cc", |
| 213 | ] |
| 214 | } |
| 215 | |
| 216 | pdfium_fuzzer("pdf_streamparser_fuzzer") { |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 217 | sources = [ |
| 218 | "pdf_streamparser_fuzzer.cc", |
| 219 | ] |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 220 | } |