Skip to content

Commit 99e6a16

Browse files
committed
libvpx: add encoder targets
and nalloc (alloc failures) targets
1 parent c06b5d3 commit 99e6a16

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

projects/libvpx/build.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ LDFLAGS="$CXXFLAGS" LD=$CXX $SRC/libvpx/configure \
3838
--extra-cflags="${extra_c_flags}" \
3939
--disable-webm-io \
4040
--enable-debug \
41-
--disable-vp8-encoder \
42-
--disable-vp9-encoder
41+
--enable-vp8-encoder \
42+
--enable-vp9-encoder
4343
make -j$(nproc) all
4444
popd
4545

@@ -60,4 +60,22 @@ for decoder in "${fuzzer_decoders[@]}"; do
6060
-Wl,--end-group
6161
cp $SRC/vpx_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip
6262
cp $SRC/vpx_dec_fuzzer.dict $OUT/${fuzzer_name}.dict
63+
cp $OUT/${fuzzer_name} $OUT/${fuzzer_name}_nalloc
64+
done
65+
66+
fuzzer_src_name=vpx_enc_fuzzer
67+
fuzzer_encoders=( 'vp9' 'vp8' )
68+
for encoder in "${fuzzer_encoders[@]}"; do
69+
fuzzer_name=${fuzzer_src_name}"_"${encoder}
70+
71+
$CXX $CXXFLAGS -std=c++11 \
72+
-DENCODER=${encoder} \
73+
-I$SRC/libvpx \
74+
-I${build_dir} \
75+
-Wl,--start-group \
76+
$LIB_FUZZING_ENGINE \
77+
$SRC/libvpx/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \
78+
${build_dir}/libvpx.a \
79+
-Wl,--end-group
80+
cp $OUT/${fuzzer_name} $OUT/${fuzzer_name}_nalloc
6381
done

0 commit comments

Comments
 (0)