Skip to content

Commit

Permalink
Fix OpenH264 based on OSS-Fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
DonggeLiu committed Dec 23, 2023
1 parent 2bc06d4 commit 1a31072
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
21 changes: 9 additions & 12 deletions benchmarks/openh264_decoder_fuzzer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:87ca1e9e19235e731fac8de8d1892ebe8d55caf18e7aa131346fc582a2034fdd
MAINTAINER twsmith@mozilla.com

RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y \
libstdc++-9-dev libstdc++-9-dev:i386 nasm subversion

RUN git clone \
https://github.com/cisco/openh264.git

WORKDIR openh264
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && \
apt-get install -y ffmpeg libstdc++-9-dev libstdc++-9-dev:i386 nasm subversion
RUN git clone --depth 1 https://github.com/cisco/openh264.git openh264
RUN python3 -m pip install corpus-replicator
RUN corpus-replicator -o corpus video_h264_264_libx264.yml video
RUN mv openh264/res/*.264 corpus/
RUN zip -j0r decoder_fuzzer_seed_corpus.zip corpus/
WORKDIR /src/openh264
COPY build.sh decoder_fuzzer.cpp $SRC/
7 changes: 1 addition & 6 deletions benchmarks/openh264_decoder_fuzzer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@
#
################################################################################

# prepare corpus
svn export https://github.com/mozillasecurity/fuzzdata.git/trunk/samples/h264 corpus/
mv ./res/*.264 ./corpus/
zip -j0r ${OUT}/decoder_fuzzer_seed_corpus.zip ./corpus/

# build
if [[ $CXXFLAGS = *sanitize=memory* ]]; then
ASM_BUILD=No
else
ASM_BUILD=Yes
fi
make -j$(nproc) ARCH=$ARCHITECTURE USE_ASM=$ASM_BUILD BUILDTYPE=Debug libraries
make -j$(nproc) ARCH=$ARCHITECTURE USE_ASM=$ASM_BUILD BUILDTYPE=Debug libopenh264.a
$CXX $CXXFLAGS -o $OUT/decoder_fuzzer -I./codec/api/wels -I./codec/console/common/inc -I./codec/common/inc -L. $LIB_FUZZING_ENGINE $SRC/decoder_fuzzer.cpp libopenh264.a

0 comments on commit 1a31072

Please sign in to comment.