diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 8ad6d5cf..6169da14 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -1,3 +1,6 @@ +TESTS = \ + test_fuzz.sh + FUZZPROGS = \ jpegsave_buffer_fuzzer \ pngsave_buffer_fuzzer \ @@ -16,5 +19,7 @@ LDADD = ${top_builddir}/libvips/libvips.la @VIPS_LIBS@ @LIB_FUZZING_ENGINE@ libstandaloneengine_a_SOURCES = StandaloneFuzzTargetMain.c -noinst_PROGRAMS = $(FUZZPROGS) +check_PROGRAMS = $(FUZZPROGS) noinst_LIBRARIES = $(FUZZLIBS) + +EXTRA_DIST = $(TESTS) diff --git a/fuzz/jpegsave_buffer_fuzzer_corpus/.keep b/fuzz/jpegsave_buffer_fuzzer_corpus/.keep new file mode 100644 index 00000000..e69de29b diff --git a/fuzz/pngsave_buffer_fuzzer_corpus/.keep b/fuzz/pngsave_buffer_fuzzer_corpus/.keep new file mode 100644 index 00000000..e69de29b diff --git a/fuzz/sharpen_fuzzer_corpus/.keep b/fuzz/sharpen_fuzzer_corpus/.keep new file mode 100644 index 00000000..e69de29b diff --git a/fuzz/test_fuzz.sh b/fuzz/test_fuzz.sh new file mode 100755 index 00000000..02af3c48 --- /dev/null +++ b/fuzz/test_fuzz.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +#set -x +set -e + +# Glib is build without -fno-omit-frame-pointer. We need +# to disable the fast unwinder to get full stacktraces. +export ASAN_OPTIONS="fast_unwind_on_malloc=0:allocator_may_return_null=1" + +# Hide all warning messages from vips. +export VIPS_WARNING=0 + +ret=0 + +for fuzzer in *_fuzzer; do + find "${fuzzer}_corpus" -type f -not -empty -print0 \ + | xargs -0 -n1 "./$fuzzer" || ret=1 +done + +exit $ret diff --git a/fuzz/thumbnail_fuzzer_corpus/.keep b/fuzz/thumbnail_fuzzer_corpus/.keep new file mode 100644 index 00000000..e69de29b diff --git a/fuzz/webpsave_buffer_fuzzer_corpus/.keep b/fuzz/webpsave_buffer_fuzzer_corpus/.keep new file mode 100644 index 00000000..e69de29b