From c92a71cb98920440c6c394c41a462253920a764a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 7 Oct 2019 14:58:49 +0100 Subject: [PATCH] fix pngload segv on header error --- libvips/foreign/vipspng.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 6d5cca88..1ba84628 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -580,8 +580,9 @@ vips__png_header( const char *name, VipsImage *out ) { Read *read; - if( !(read = read_new_filename( out, name, TRUE )) || - png2vips_header( read, out ) ) { + if( !(read = read_new_filename( out, name, TRUE )) ) + return( -1 ); + if( png2vips_header( read, out ) ) { read_close_input( read ); return( -1 ); }