Skip to content

Commit

Permalink
[FFmpeg] Add Support for tools/target_enc_fuzzer (#11933)
Browse files Browse the repository at this point in the history
Code is based on the target_dec_fuzzer specific code

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni authored May 10, 2024
1 parent 26e4aaa commit 204d784
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions projects/ffmpeg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,23 @@ for c in $CONDITIONALS; do
patchelf --set-rpath '$ORIGIN/lib' $OUT/$fuzzer_name
done

# Build fuzzers for encoders
CONDITIONALS=$(grep 'ENCODER 1$' config_components.h | sed 's/#define CONFIG_\(.*\)_ENCODER 1/\1/')
if [ -n "${OSS_FUZZ_CI-}" ]; then
# When running in CI, check the first targets only to save time and disk space
CONDITIONALS=(${CONDITIONALS[@]:0:2})
fi

for c in $CONDITIONALS; do
fuzzer_name=ffmpeg_AV_CODEC_ID_${c}_fuzzer
symbol=$(echo $c | sed "s/.*/\L\0/")
echo -en "[libfuzzer]\nmax_len = 1000000\n" >$OUT/${fuzzer_name}.options
make tools/target_enc_${symbol}_fuzzer
mv tools/target_enc_${symbol}_fuzzer $OUT/${fuzzer_name}
patchelf --set-rpath '$ORIGIN/lib' $OUT/$fuzzer_name
done


# Build fuzzer for sws
fuzzer_name=ffmpeg_SWS_fuzzer
echo -en "[libfuzzer]\nmax_len = 1000000\n" >$OUT/${fuzzer_name}.options
Expand Down

0 comments on commit 204d784

Please sign in to comment.