From b78d39571f2f004685f9bafb632c3d7105d63654 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Fri, 5 Jul 2024 11:26:12 +0200 Subject: [PATCH] Disable TIFF on fuzztest. oss-fuzz does not support dynamic libraries so we stick to static. But libtiff.a has undefined symbols on Ubuntu, so we have to disable TIFF. Change-Id: Ibd1932f5780a0af51b6b398ae6415eed8685a0be --- tests/fuzzer/imageio_fuzzer.cc | 6 ------ tests/fuzzer/oss-fuzz/build.sh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/fuzzer/imageio_fuzzer.cc b/tests/fuzzer/imageio_fuzzer.cc index 7ce97120..0e2b5beb 100644 --- a/tests/fuzzer/imageio_fuzzer.cc +++ b/tests/fuzzer/imageio_fuzzer.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include "imageio/image_dec.h" #include "imageio/metadata.h" @@ -51,11 +50,6 @@ constexpr WebPInputFileFormat kUnknown = WEBP_UNSUPPORTED_FORMAT; void Decode(std::string_view arbitrary_bytes, WebPInputFileFormat format, bool keep_alpha, bool use_argb) { - if (format == kUnknown || format == WEBP_TIFF_FORMAT) { - TIFFSetErrorHandler(NULL); // libtiff can be verbose about errors. - TIFFSetWarningHandler(NULL); // Silence it to avoid timeouts. - } - const uint8_t *data = reinterpret_cast(arbitrary_bytes.data()); const size_t size = arbitrary_bytes.size(); diff --git a/tests/fuzzer/oss-fuzz/build.sh b/tests/fuzzer/oss-fuzz/build.sh index 972a7772..dece65bc 100644 --- a/tests/fuzzer/oss-fuzz/build.sh +++ b/tests/fuzzer/oss-fuzz/build.sh @@ -47,7 +47,7 @@ EXTRA_CMAKE_FLAGS="-DFUZZTEST_COMPATIBILITY_MODE=libfuzzer" WEBP_CFLAGS="$CFLAGS -DWEBP_MAX_IMAGE_SIZE=838860800" # 800MiB export CFLAGS="$WEBP_CFLAGS" -cmake -S . -B build -DWEBP_BUILD_FUZZTEST=ON -DWEBP_LINK_STATIC=OFF ${EXTRA_CMAKE_FLAGS} +cmake -S . -B build -DWEBP_BUILD_FUZZTEST=ON ${EXTRA_CMAKE_FLAGS} cd build && make -j$(nproc) && cd .. find $SRC/libwebp-test-data -type f -size -32k -iname "*.webp" \