[stb] extend code coverage for stb_image (#3784)

* [stb] extend code coverage for stb_image

* remove wget's from build.sh

* add wget's to Dockerfile

* fix Dockerfile
This commit is contained in:
Randy 2020-05-26 19:26:42 +02:00 committed by GitHub
parent 56770c7f56
commit 4ef2d5c359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View File

@ -16,9 +16,16 @@
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && \
apt-get install -y wget tar
MAINTAINER randy408@protonmail.com
RUN git clone --depth 1 https://github.com/nothings/stb.git
RUN wget -O $SRC/stb/gif.tar.gz https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/imagetestsuite/imagetestsuite-gif-1.00.tar.gz
RUN wget -O $SRC/stb/jpg.tar.gz https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/imagetestsuite/imagetestsuite-jpg-1.00.tar.gz
RUN wget -O $SRC/stb/tests/gif.dict https://raw.githubusercontent.com/mirrorer/afl/master/dictionaries/gif.dict &> /dev/null
WORKDIR stb
COPY build.sh $SRC/

View File

@ -15,11 +15,27 @@
#
################################################################################
$CXX $CXXFLAGS -std=c++11 -I. \
$SRC/stb/tests/stb_png_read_fuzzer.cpp \
# remove this line when this change is upstreamed
sed '2d' $SRC/stb/tests/stb_png_read_fuzzer.cpp > $SRC/stb/tests/stbi_read_fuzzer.c
$CXX $CXXFLAGS -std=c++11 -I. -DSTBI_ONLY_PNG \
$SRC/stb/tests/stbi_read_fuzzer.c \
-o $OUT/stb_png_read_fuzzer $LIB_FUZZING_ENGINE
$CXX $CXXFLAGS -std=c++11 -I. \
$SRC/stb/tests/stbi_read_fuzzer.c \
-o $OUT/stbi_read_fuzzer $LIB_FUZZING_ENGINE
find $SRC/stb/tests/pngsuite -name "*.png" | \
xargs zip $OUT/stb_png_read_fuzzer_seed_corpus.zip
cp $SRC/stb/tests/stb_png.dict $OUT/stb_png_read_fuzzer.dict
tar xvzf $SRC/stb/jpg.tar.gz --directory $SRC/stb/tests
tar xvzf $SRC/stb/gif.tar.gz --directory $SRC/stb/tests
find $SRC/stb/tests -name "*.png" -o -name "*.jpg" -o -name ".gif" | \
xargs zip $OUT/stbi_read_fuzzer_seed_corpus.zip
echo "" >> $SRC/stb/tests/gif.dict
cat $SRC/stb/tests/gif.dict $SRC/stb/tests/stb_png.dict > $OUT/stbi_read_fuzzer.dict