mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-08 09:56:49 +02:00
Limit the possible fuzz engines.
Change-Id: I8f2fd84bc7175e4e74c4fb418fcc4f5549018ac3
This commit is contained in:
parent
4f200de591
commit
20e92f7d40
@ -34,10 +34,15 @@
|
|||||||
# And then run the fuzzer locally, for example:
|
# And then run the fuzzer locally, for example:
|
||||||
# python3 infra/helper.py run_fuzzer libwebp \
|
# python3 infra/helper.py run_fuzzer libwebp \
|
||||||
# --sanitizer address \
|
# --sanitizer address \
|
||||||
# animencoder_fuzzer__AnimEncoder.AnimEncoderTest
|
# animencoder_fuzzer@AnimEncoder.AnimEncoderTest
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# Avoid fuzz engines that do not compile.
|
||||||
|
if [[ "$FUZZING_ENGINE" != "libfuzzer" ]]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# limit allocation size to reduce spurious OOMs
|
# limit allocation size to reduce spurious OOMs
|
||||||
WEBP_CFLAGS="$CFLAGS -DWEBP_MAX_IMAGE_SIZE=838860800" # 800MiB
|
WEBP_CFLAGS="$CFLAGS -DWEBP_MAX_IMAGE_SIZE=838860800" # 800MiB
|
||||||
|
|
||||||
@ -48,8 +53,6 @@ cd build && make -j$(nproc) && cd ..
|
|||||||
find $SRC/libwebp-test-data -type f -size -32k -iname "*.webp" \
|
find $SRC/libwebp-test-data -type f -size -32k -iname "*.webp" \
|
||||||
-exec zip -qju fuzz_seed_corpus.zip "{}" \;
|
-exec zip -qju fuzz_seed_corpus.zip "{}" \;
|
||||||
|
|
||||||
# Restrict fuzztest tests to the only compatible fuzz engine: libfuzzer.
|
|
||||||
if [[ "$FUZZING_ENGINE" == "libfuzzer" ]]; then
|
|
||||||
# build fuzztests
|
# build fuzztests
|
||||||
# The following is taken from https://github.com/google/oss-fuzz/blob/31ac7244748ea7390015455fb034b1f4eda039d9/infra/base-images/base-builder/compile_fuzztests.sh#L59
|
# The following is taken from https://github.com/google/oss-fuzz/blob/31ac7244748ea7390015455fb034b1f4eda039d9/infra/base-images/base-builder/compile_fuzztests.sh#L59
|
||||||
# Iterate the fuzz binaries and list each fuzz entrypoint in the binary. For
|
# Iterate the fuzz binaries and list each fuzz entrypoint in the binary. For
|
||||||
@ -80,4 +83,3 @@ chmod -x \$this_dir/$fuzz_basename" > $OUT/$TARGET_FUZZER
|
|||||||
cp fuzz_seed_corpus.zip $OUT/${fuzz_basename}_seed_corpus.zip
|
cp fuzz_seed_corpus.zip $OUT/${fuzz_basename}_seed_corpus.zip
|
||||||
cp tests/fuzzer/fuzz.dict $OUT/${fuzz_basename}.dict
|
cp tests/fuzzer/fuzz.dict $OUT/${fuzz_basename}.dict
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user