diff --git a/projects/libspng/Dockerfile b/projects/libspng/Dockerfile index 55c4c2edb..ee5f14e3f 100644 --- a/projects/libspng/Dockerfile +++ b/projects/libspng/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get update && \ apt-get install -y pkg-config zlib1g-dev RUN git clone --depth 1 https://gitlab.com/randy408/libspng.git +RUN git clone --depth 1 https://github.com/google/fuzzer-test-suite WORKDIR libspng COPY build.sh $SRC/ diff --git a/projects/libspng/build.sh b/projects/libspng/build.sh index 62223bbd0..f08577340 100644 --- a/projects/libspng/build.sh +++ b/projects/libspng/build.sh @@ -24,6 +24,13 @@ $CXX $CXXFLAGS -std=c++11 -I. \ -o $OUT/spng_read_fuzzer \ -lFuzzingEngine $SRC/libspng/build/libspng.a -lz +$CXX $CXXFLAGS -std=c++11 -I. \ + $SRC/libspng/tests/spng_read_fuzzer.cc \ + -o $OUT/spng_read_fuzzer_structure_aware \ + -include ../fuzzer-test-suite/libpng-1.2.56/png_mutator.h \ + -D PNG_MUTATOR_DEFINE_LIBFUZZER_CUSTOM_MUTATOR \ + -lFuzzingEngine $SRC/libspng/build/libspng.a -lz + find $SRC/libspng/tests/images -name "*.png" | \ xargs zip $OUT/spng_read_fuzzer_seed_corpus.zip