[FFmpeg] Add fuzzers for individual demuxers (#4529)

This should improve coverage of libavformat
This commit is contained in:
Michael Niedermayer 2020-10-15 04:15:14 +02:00 committed by GitHub
parent f0a3de78ff
commit 2cd2ee63d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 0 deletions

View File

@ -198,6 +198,44 @@ fuzzer_name=ffmpeg_IO_DEMUXER_fuzzer
make tools/target_io_dem_fuzzer
mv tools/target_io_dem_fuzzer $OUT/${fuzzer_name}
#Build fuzzers for individual demuxers
PKG_CONFIG_PATH="$FFMPEG_DEPS_PATH/lib/pkgconfig" ./configure \
--cc=$CC --cxx=$CXX --ld="$CXX $CXXFLAGS -std=c++11" \
--extra-cflags="-I$FFMPEG_DEPS_PATH/include" \
--extra-ldflags="-L$FFMPEG_DEPS_PATH/lib" \
--prefix="$FFMPEG_DEPS_PATH" \
--pkg-config-flags="--static" \
--enable-ossfuzz \
--libfuzzer=$LIB_FUZZING_ENGINE \
--optflags=-O1 \
--enable-gpl \
--disable-muxers \
--disable-protocols \
--disable-devices \
--disable-shared \
--disable-encoders \
--disable-filters \
--disable-muxers \
--disable-parsers \
--disable-decoders \
--disable-hwaccels \
--disable-bsfs \
--disable-vaapi \
--disable-vdpau \
--disable-crystalhd \
--disable-v4l2_m2m \
--disable-cuda_llvm \
--enable-demuxers \
--disable-demuxer=rtp,rtsp,sdp \
CONDITIONALS=`grep 'DEMUXER 1$' config.h | sed 's/#define CONFIG_\(.*\)_DEMUXER 1/\1/'`
for c in $CONDITIONALS ; do
fuzzer_name=ffmpeg_dem_${c}_fuzzer
symbol=`echo $c | sed "s/.*/\L\0/"`
make tools/target_dem_${symbol}_fuzzer
mv tools/target_dem_${symbol}_fuzzer $OUT/${fuzzer_name}
done
# Find relevant corpus in test samples and archive them for every fuzzer.
#cd $SRC
#python group_seed_corpus.py $TEST_SAMPLES_PATH $OUT/