diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-05-09 21:06:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-09 21:06:22 +0000 |
commit | 607f3cd63a314cd3a6c219b19cce31805b66cd6d (patch) | |
tree | 74c9bff427b4c8f4697ee28b17bbebe2be411cb2 /testing/libfuzzer/xfa_codec_fuzzer.h | |
parent | d5d48457dabbe71e7f6b0baf2eaea6aa0dc86736 (diff) | |
download | pdfium-607f3cd63a314cd3a6c219b19cce31805b66cd6d.tar.xz |
Do not build GIF when codec is disabled
Currently all of the GIF 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 GIF codec code if support
for GIF is turned off.
This also catches a few missed cases from previous CLs.
BUG=pdfium:1080
Change-Id: Ie7fe2d894d2ae2f8f36ae05e0ff256f2ce6ef8d4
Reviewed-on: https://pdfium-review.googlesource.com/32330
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'testing/libfuzzer/xfa_codec_fuzzer.h')
-rw-r--r-- | testing/libfuzzer/xfa_codec_fuzzer.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/testing/libfuzzer/xfa_codec_fuzzer.h b/testing/libfuzzer/xfa_codec_fuzzer.h index b1d888f380..483177e232 100644 --- a/testing/libfuzzer/xfa_codec_fuzzer.h +++ b/testing/libfuzzer/xfa_codec_fuzzer.h @@ -8,15 +8,24 @@ #include <memory> #include "core/fxcodec/codec/ccodec_bmpmodule.h" -#include "core/fxcodec/codec/ccodec_gifmodule.h" -#include "core/fxcodec/codec/ccodec_pngmodule.h" #include "core/fxcodec/codec/ccodec_progressivedecoder.h" -#include "core/fxcodec/codec/ccodec_tiffmodule.h" #include "core/fxcodec/fx_codec.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "testing/fx_string_testhelpers.h" #include "third_party/base/ptr_util.h" +#ifdef PDF_ENABLE_XFA_GIF +#include "core/fxcodec/codec/ccodec_gifmodule.h" +#endif // PDF_ENABLE_XFA_GIF + +#ifdef PDF_ENABLE_XFA_PNG +#include "core/fxcodec/codec/ccodec_pngmodule.h" +#endif // PDF_ENABLE_XFA_PNG + +#ifdef PDF_ENABLE_XFA_TIFF +#include "core/fxcodec/codec/ccodec_tiffmodule.h" +#endif // PDF_ENABLE_XFA_TIFF + // Support up to 64 MB. This prevents trivial OOM when MSAN is on and // time outs. const int kXFACodecFuzzerPixelLimit = 64000000; @@ -26,9 +35,15 @@ class XFACodecFuzzer { static int Fuzz(const uint8_t* data, size_t size, FXCODEC_IMAGE_TYPE type) { auto mgr = pdfium::MakeUnique<CCodec_ModuleMgr>(); mgr->SetBmpModule(pdfium::MakeUnique<CCodec_BmpModule>()); +#ifdef PDF_ENABLE_XFA_GIF mgr->SetGifModule(pdfium::MakeUnique<CCodec_GifModule>()); +#endif // PDF_ENABLE_XFA_GIF +#ifdef PDF_ENABLE_XFA_PNG mgr->SetPngModule(pdfium::MakeUnique<CCodec_PngModule>()); +#endif // PDF_ENABLE_XFA_PNG +#ifdef PDF_ENABLE_XFA_TIFF mgr->SetTiffModule(pdfium::MakeUnique<CCodec_TiffModule>()); +#endif // PDF_ENABLE_XFA_TIFF std::unique_ptr<CCodec_ProgressiveDecoder> decoder = mgr->CreateProgressiveDecoder(); |