Script to download and test ossfuzz testcases This also includes a list of such testcases. I intend to subsequently fill this list with the cases we have fixed in the past
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> --- tools/target_dec_fate.list | 6 ++++ tools/target_dec_fate.sh | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tools/target_dec_fate.list create mode 100755 tools/target_dec_fate.sh diff --git a/tools/target_dec_fate.list b/tools/target_dec_fate.list new file mode 100644 index 0000000000..e0509aaa64 --- /dev/null +++ b/tools/target_dec_fate.list @@ -0,0 +1,6 @@ +544/clusterfuzz-testcase-5936536407244800.f8bd9b24_8ba77916_70c2c7be_3df6a2ea_96cd9f14 target_dec_interplay_video_fuzzer +724/clusterfuzz-testcase-6738249571631104 target_dec_pictor_fuzzer +1214/clusterfuzz-testcase-minimized-6130606599569408 target_dec_h264_fuzzer +5264/clusterfuzz-testcase-minimized-4621956621008896 target_dec_indeo5_fuzzer +7279/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5977332473921536 target_dec_g2m_fuzzer +10053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5636993883570176 target_dec_prosumer_fuzzer diff --git a/tools/target_dec_fate.sh b/tools/target_dec_fate.sh new file mode 100755 index 0000000000..d4e11955ac --- /dev/null +++ b/tools/target_dec_fate.sh @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Copyleft (c) Michael Niedermayer + +set -e + +LC_ALL=C +export LC_ALL + +LIST=target_dec_fate.list + +show_help(){ + cat <<EOF +Usage: ./target_dec_fate.sh <directory> [<test to run>] + +directory the directory into which sample files will be downloaded +test to run the number of the issue to test +Note, some test samples may not yet be available to the public, also this +script will not download samples which are already in the directory. So you +may want to preserve its content between runs. +EOF + exit 0 +} + +test -z "$1" && show_help +test ! -d "$1" && echo $1 is not an accessable directory && show_help +test ! -f target_dec_fate.sh && echo $0 Must be run from its location && show_help +grep 'CONFIG_OSSFUZZ 0' ../config.h && echo not configured for ossfuzz && show_help + +#Download testcases +while read -r LINE; do + ISSUE_NUM=`echo $LINE | sed 's#/.*##'` + FILE_ID=`echo $LINE | sed 's#.*/clusterfuzz-testcase[a-zA-Z0-9_-]*-\([0-9]*\).*#\1#'` + FILE=`echo $LINE | sed 's# .*##'` + if test -f "$1/$FILE" ; then + echo exists $FILE + else + echo downloading $FILE + mkdir -p "$1/$ISSUE_NUM" + wget -O "$1/$FILE" "https://oss-fuzz.com/download?testcase_id=$FILE_ID" || rm "$1/$FILE" + fi +done < "$LIST" + +#Find which fuzzers we need to build +TOOLS= +while read -r LINE; do + TOOL_ID=`echo $LINE | sed 's#[^ ]* ##'` + TOOLS="$TOOLS tools/$TOOL_ID" +done < "$LIST" + +cd .. +#Build fuzzers +make -j4 $TOOLS + +#Run testcases +while read -r LINE; do + TOOL_ID=`echo $LINE | sed 's#[^ ]* ##'` + FILE=`echo $LINE | sed 's# .*##'` + tools/$TOOL_ID $1/$FILE +done < "tools/$LIST" + +echo OK \ No newline at end of file -- 2.18.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel