summaryrefslogtreecommitdiff
path: root/testing/libfuzzer
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-05-09 14:42:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-09 14:42:42 +0000
commit27924e6c9d43f0eba57d14004853d5a8ba47de26 (patch)
treefcc6639b62cf2fee783123b1858c618ba773da2e /testing/libfuzzer
parent5f7c5be8b7072d46e8d8088a1ec14370ecfad44c (diff)
downloadpdfium-27924e6c9d43f0eba57d14004853d5a8ba47de26.tar.xz
Do not build TIFF when codec is disabled
Currently all of the TIFF related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the TIFF codec code if support for TIFF is turned off. It also fixes cases in the code base where tif was being used instead of tiff. BUG=pdfium:1080 Change-Id: If6aaa8af5160fdd5b261e63bab7d5984196efcc9 Reviewed-on: https://pdfium-review.googlesource.com/32193 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/libfuzzer')
-rw-r--r--testing/libfuzzer/BUILD.gn16
-rw-r--r--testing/libfuzzer/pdf_codec_tiff_fuzzer.cc2
2 files changed, 11 insertions, 7 deletions
diff --git a/testing/libfuzzer/BUILD.gn b/testing/libfuzzer/BUILD.gn
index ba368948e2..a45c8d2576 100644
--- a/testing/libfuzzer/BUILD.gn
+++ b/testing/libfuzzer/BUILD.gn
@@ -43,12 +43,14 @@ group("libfuzzer") {
":pdf_codec_gif_fuzzer",
":pdf_codec_jpeg_fuzzer",
":pdf_codec_png_fuzzer",
- ":pdf_codec_tiff_fuzzer",
":pdf_css_fuzzer",
":pdf_fm2js_fuzzer",
":pdf_formcalc_fuzzer",
":pdf_lzw_fuzzer",
]
+ if (pdf_enable_xfa_tiff) {
+ deps += [ ":pdf_codec_tiff_fuzzer" ]
+ }
}
}
@@ -105,11 +107,13 @@ if (pdf_enable_xfa) {
]
}
- pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
- sources = [
- "pdf_codec_tiff_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ if (pdf_enable_xfa_tiff) {
+ pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
+ sources = [
+ "pdf_codec_tiff_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ }
}
pdfium_fuzzer("pdf_css_fuzzer") {
diff --git a/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc b/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc
index 483ac28306..8e28d0fd12 100644
--- a/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc
+++ b/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc
@@ -5,5 +5,5 @@
#include "testing/libfuzzer/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_TIF);
+ return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_TIFF);
}