diff --git a/fuzz/test_fuzz.sh b/fuzz/test_fuzz.sh index e536e113..ab935785 100755 --- a/fuzz/test_fuzz.sh +++ b/fuzz/test_fuzz.sh @@ -14,8 +14,13 @@ export VIPS_WARNING=0 ret=0 for fuzzer in *_fuzzer; do + fail=0 find "common_fuzzer_corpus" -type f -not -empty -print0 \ - | xargs -0 -n1 "./$fuzzer" || ret=1 + | xargs -0 -n1 "./$fuzzer" || fail=1 + if [ $fail ]; then + echo FAIL $fuzzer + ret=1 + fi done exit $ret diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 0d63b71f..6d5cca88 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -208,6 +208,10 @@ read_open_input( Read *read ) return( -1 ); if( read->seek_position != -1 ) fseek( read->fp, read->seek_position, SEEK_SET ); + + /* Just takes a copy of the fp. + */ + png_init_io( read->pPng, read->fp ); } return( 0 ); @@ -324,7 +328,6 @@ read_new_filename( VipsImage *out, const char *name, gboolean fail ) return( NULL ); } - png_init_io( read->pPng, read->fp ); read_info( read ); return( read ); diff --git a/test/test_descriptors b/test/test_descriptors index 0e0b2c0c..b23aa906 100755 --- a/test/test_descriptors +++ b/test/test_descriptors @@ -188,7 +188,7 @@ func_exec_program () if test -f "$progdir/$program"; then # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/john/GIT/libvips/libvips/.libs:/home/john/vips/lib:$LD_LIBRARY_PATH" + LD_LIBRARY_PATH="/home/john/GIT/libvips/libvips/.libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH # The second colon is a workaround for a bug in BeOS R4 sed diff --git a/test/test_descriptors.sh b/test/test_descriptors.sh index 4ce21404..0d644949 100755 --- a/test/test_descriptors.sh +++ b/test/test_descriptors.sh @@ -26,3 +26,7 @@ fi if test_supported pngload; then ./test_descriptors $test_images/sample.png fi + +if test_supported webpload; then + ./test_descriptors $test_images/1.webp +fi