From 8875e23128affd17a479308c14b7f808b62e0fd4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 10 Sep 2014 09:05:13 +0100 Subject: [PATCH] fix a setjmp() loop in pngread see https://github.com/jcupitt/libvips/issues/175 stupid setjmp() --- libvips/foreign/vipspng.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index f89bb58d..66f7e396 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -509,6 +509,11 @@ png2vips_generate( VipsRegion *or, read->y_pos += 1; } + /* Turn errors back on. png_read_end() can trigger them too. + */ + if( setjmp( png_jmpbuf( read->pPng ) ) ) + return( -1 ); + /* We need to shut down the reader immediately at the end of read or * we won't detach ready for the next image. */