Skip to content

Commit ca6925a

Browse files
committed
new targets
1 parent 1eeadf5 commit ca6925a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1444
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2018 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd
18+
19+
RUN apt-get update && apt-get install -y cmake yasm wget
20+
RUN git clone https://aomedia.googlesource.com/aom
21+
ADD https://storage.googleapis.com/aom-test-data/fuzzer/dec_fuzzer_seed_corpus.zip $SRC/
22+
COPY build.sh $SRC/
23+
WORKDIR aom
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 4601636403675136
2+
commit: 6E184898310E49E33231B508618D6FDE8B84AB90
3+
fuzz_target: av1_dec_fuzzer
4+
project: libaom
5+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash -eu
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# Build libaom
19+
build_dir=$WORK/build
20+
mkdir -p ${build_dir}
21+
pushd ${build_dir}
22+
# Remove files generated by the previous build.
23+
rm -rf ./*
24+
25+
# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation
26+
# limit in libaom to 1 GB to avoid OOM errors. A smaller per-allocation is
27+
# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499).
28+
if [[ $CFLAGS = *sanitize=memory* ]]; then
29+
extra_c_flags='-DAOM_MAX_ALLOCABLE_MEMORY=536870912'
30+
else
31+
extra_c_flags='-DAOM_MAX_ALLOCABLE_MEMORY=1073741824'
32+
fi
33+
# Also, enable DO_RANGE_CHECK_CLAMP to suppress the noise of integer overflows
34+
# in the transform functions.
35+
extra_c_flags+=' -DDO_RANGE_CHECK_CLAMP=1'
36+
37+
extra_cmake_flags=
38+
# MemorySanitizer requires that all program code is instrumented. Therefore we
39+
# need to replace all inline assembly code that writes to memory with pure C
40+
# code. Disable all assembly code for MemorySanitizer.
41+
if [[ $CFLAGS = *sanitize=memory* ]]; then
42+
extra_cmake_flags+="-DAOM_TARGET_CPU=generic"
43+
fi
44+
45+
cmake $SRC/aom -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE='-O3 -g' \
46+
-DCMAKE_CXX_FLAGS_RELEASE='-O3 -g' -DCONFIG_PIC=1 -DCONFIG_LOWBITDEPTH=1 \
47+
-DCONFIG_AV1_ENCODER=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTS=0 \
48+
-DCONFIG_SIZE_LIMIT=1 -DDECODE_HEIGHT_LIMIT=12288 -DDECODE_WIDTH_LIMIT=12288 \
49+
-DAOM_EXTRA_C_FLAGS="${extra_c_flags}" -DENABLE_TOOLS=0 \
50+
-DAOM_EXTRA_CXX_FLAGS="${extra_c_flags}" ${extra_cmake_flags}
51+
make -j$(nproc)
52+
popd
53+
54+
# build fuzzers
55+
fuzzer_src_name=av1_dec_fuzzer
56+
fuzzer_name=${fuzzer_src_name}
57+
58+
$CXX $CXXFLAGS -std=c++11 \
59+
-I$SRC/aom \
60+
-I${build_dir} \
61+
-Wl,--start-group \
62+
$LIB_FUZZING_ENGINE \
63+
$SRC/aom/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \
64+
${build_dir}/libaom.a -Wl,--end-group
65+
66+
# copy seed corpus.
67+
cp $SRC/dec_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip
68+
cp $SRC/aom/examples/av1_dec_fuzzer.dict $OUT/${fuzzer_name}.dict
69+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2018 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder@sha256:fb1a9a49752c9e504687448d1f1a048ec1e062e2e40f7e8a23e86b63ff3dad7c
18+
RUN apt-get update && apt-get install -y yasm wget gcc
19+
RUN git clone https://chromium.googlesource.com/webm/libvpx
20+
ADD https://storage.googleapis.com/downloads.webmproject.org/test_data/fuzzer/vpx_fuzzer_seed_corpus.zip $SRC/
21+
COPY build.sh vpx_dec_fuzzer.dict $SRC/
22+
WORKDIR libvpx
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
commit: 349820a50dd2c0afbfb26f7b12fc1a83588a52c0
2+
commit_date: 2025-03-13 22:58:09+00:00
3+
fuzz_target: vpx_dec_fuzzer_vp8
4+
project: libvpx
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash -eu
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# Build libvpx
19+
build_dir=$WORK/build
20+
rm -rf ${build_dir}
21+
mkdir -p ${build_dir}
22+
pushd ${build_dir}
23+
24+
# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation
25+
# limit in libvpx to 1 GB to avoid OOM errors. A smaller per-allocation is
26+
# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499).
27+
if [[ $CFLAGS = *sanitize=memory* ]]; then
28+
extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=536870912'
29+
else
30+
extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=1073741824'
31+
fi
32+
33+
LDFLAGS="$CXXFLAGS" LD=$CXX $SRC/libvpx/configure \
34+
--enable-vp9-highbitdepth \
35+
--disable-unit-tests \
36+
--disable-examples \
37+
--size-limit=12288x12288 \
38+
--extra-cflags="${extra_c_flags}" \
39+
--disable-webm-io \
40+
--enable-debug \
41+
--disable-vp8-encoder \
42+
--disable-vp9-encoder
43+
make -j$(nproc) all
44+
popd
45+
46+
# build fuzzers
47+
fuzzer_src_name=vpx_dec_fuzzer
48+
fuzzer_decoders=( 'vp9' 'vp8' )
49+
for decoder in "${fuzzer_decoders[@]}"; do
50+
fuzzer_name=${fuzzer_src_name}"_"${decoder}
51+
52+
$CXX $CXXFLAGS -std=c++11 \
53+
-DDECODER=${decoder} \
54+
-I$SRC/libvpx \
55+
-I${build_dir} \
56+
-Wl,--start-group \
57+
$LIB_FUZZING_ENGINE \
58+
$SRC/libvpx/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \
59+
${build_dir}/libvpx.a \
60+
-Wl,--end-group
61+
cp $SRC/vpx_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip
62+
cp $SRC/vpx_dec_fuzzer.dict $OUT/${fuzzer_name}.dict
63+
done
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# IVF Signature + version (bytes 0-5)
2+
kw1="DKIF\x00\x00"
3+
4+
# VP9 codec fourCC (bytes 8-11)
5+
kw2="VP90"
6+
7+
# VP8 codec fourCC (bytes 8-11)
8+
kw3="VP80"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2018 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder@sha256:fb1a9a49752c9e504687448d1f1a048ec1e062e2e40f7e8a23e86b63ff3dad7c
18+
RUN apt-get update && apt-get install -y yasm wget gcc
19+
RUN git clone https://chromium.googlesource.com/webm/libvpx
20+
ADD https://storage.googleapis.com/downloads.webmproject.org/test_data/fuzzer/vpx_fuzzer_seed_corpus.zip $SRC/
21+
COPY build.sh vpx_dec_fuzzer.dict $SRC/
22+
WORKDIR libvpx
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
commit: 349820a50dd2c0afbfb26f7b12fc1a83588a52c0
2+
commit_date: 2025-03-13 22:58:09+00:00
3+
fuzz_target: vpx_dec_fuzzer_vp9
4+
project: libvpx
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash -eu
2+
# Copyright 2018 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# Build libvpx
19+
build_dir=$WORK/build
20+
rm -rf ${build_dir}
21+
mkdir -p ${build_dir}
22+
pushd ${build_dir}
23+
24+
# oss-fuzz has 2 GB total memory allocation limit. So, we limit per-allocation
25+
# limit in libvpx to 1 GB to avoid OOM errors. A smaller per-allocation is
26+
# needed for MemorySanitizer (see bug oss-fuzz:9497 and bug oss-fuzz:9499).
27+
if [[ $CFLAGS = *sanitize=memory* ]]; then
28+
extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=536870912'
29+
else
30+
extra_c_flags='-DVPX_MAX_ALLOCABLE_MEMORY=1073741824'
31+
fi
32+
33+
LDFLAGS="$CXXFLAGS" LD=$CXX $SRC/libvpx/configure \
34+
--enable-vp9-highbitdepth \
35+
--disable-unit-tests \
36+
--disable-examples \
37+
--size-limit=12288x12288 \
38+
--extra-cflags="${extra_c_flags}" \
39+
--disable-webm-io \
40+
--enable-debug \
41+
--disable-vp8-encoder \
42+
--disable-vp9-encoder
43+
make -j$(nproc) all
44+
popd
45+
46+
# build fuzzers
47+
fuzzer_src_name=vpx_dec_fuzzer
48+
fuzzer_decoders=( 'vp9' 'vp8' )
49+
for decoder in "${fuzzer_decoders[@]}"; do
50+
fuzzer_name=${fuzzer_src_name}"_"${decoder}
51+
52+
$CXX $CXXFLAGS -std=c++11 \
53+
-DDECODER=${decoder} \
54+
-I$SRC/libvpx \
55+
-I${build_dir} \
56+
-Wl,--start-group \
57+
$LIB_FUZZING_ENGINE \
58+
$SRC/libvpx/examples/${fuzzer_src_name}.cc -o $OUT/${fuzzer_name} \
59+
${build_dir}/libvpx.a \
60+
-Wl,--end-group
61+
cp $SRC/vpx_fuzzer_seed_corpus.zip $OUT/${fuzzer_name}_seed_corpus.zip
62+
cp $SRC/vpx_dec_fuzzer.dict $OUT/${fuzzer_name}.dict
63+
done

0 commit comments

Comments
 (0)