In fuzzing mode or compatibility mode, address sanitizer is forced.
|
if (FUZZTEST_FUZZING_MODE OR (FUZZTEST_COMPATIBILITY_MODE STREQUAL "libfuzzer")) |
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -UNDEBUG -fsanitize=address") |
This is problematic on oss-fuzz which has different sanitizers. We therefore remove those flags https://github.com/AOMediaCodec/libavif/blob/d074bae4b0b1d7423d102f6d9d5e0c5303971a51/ext/fuzztest.cmd#L14 and use the ones set in the environment variable CXXFLAGS by oss-fuzz.
I believe those sanitizer flags should only be set for FUZZTEST_FUZZING_MODE, not when FUZZTEST_COMPATIBILITY_MODE STREQUAL "libfuzzer").
In fuzzing mode or compatibility mode, address sanitizer is forced.
fuzztest/cmake/FuzzTestFlagSetup.cmake
Lines 2 to 3 in a990537
This is problematic on oss-fuzz which has different sanitizers. We therefore remove those flags https://github.com/AOMediaCodec/libavif/blob/d074bae4b0b1d7423d102f6d9d5e0c5303971a51/ext/fuzztest.cmd#L14 and use the ones set in the environment variable
CXXFLAGSby oss-fuzz.I believe those sanitizer flags should only be set for
FUZZTEST_FUZZING_MODE, not whenFUZZTEST_COMPATIBILITY_MODE STREQUAL "libfuzzer").