diff --git a/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc b/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc index b1b189f8..86137e2a 100644 --- a/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc +++ b/contrib/oss-fuzz/tiff_read_rgba_fuzzer.cc @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -40,6 +41,14 @@ extern "C" void handle_error(const char *unused, const char *unused2, va_list un extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { TIFFSetErrorHandler(handle_error); TIFFSetWarningHandler(handle_error); +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) + // libjpeg-turbo has issues with MSAN and SIMD code + // See https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7547 + // and https://github.com/libjpeg-turbo/libjpeg-turbo/pull/365 + setenv("JSIMD_FORCENONE" ,"YES", 1); +# endif +#endif std::istringstream s(std::string(Data,Data+Size)); TIFF* tif = TIFFStreamOpen("MemTIFF", &s); if (!tif) {