fix pngload segv on header error

This commit is contained in:
John Cupitt 2019-10-07 14:58:49 +01:00
parent 3510c515f2
commit c92a71cb98
1 changed files with 3 additions and 2 deletions

View File

@ -580,8 +580,9 @@ vips__png_header( const char *name, VipsImage *out )
{ {
Read *read; Read *read;
if( !(read = read_new_filename( out, name, TRUE )) || if( !(read = read_new_filename( out, name, TRUE )) )
png2vips_header( read, out ) ) { return( -1 );
if( png2vips_header( read, out ) ) {
read_close_input( read ); read_close_input( read );
return( -1 ); return( -1 );
} }