From 9be2d6cc8daed2886604e97aaaf4aeb7b8f4ee14 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 28 Nov 2014 17:54:01 +0000 Subject: [PATCH] improve vipsthumbnail with broken images if there was an incorrect embedded profile, no fallback import profile, and an export profile, vipsthumbnail could crash see https://github.com/jcupitt/libvips/issues/186 --- tools/vipsthumbnail.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/vipsthumbnail.c b/tools/vipsthumbnail.c index aff2dd7d..690d9c33 100644 --- a/tools/vipsthumbnail.c +++ b/tools/vipsthumbnail.c @@ -575,7 +575,11 @@ thumbnail_shrink( VipsObject *process, VipsImage *in, out = t[7]; } - in = out; + /* If the embedded profile failed and there's no fallback or + * the fallback failed, out will still be NULL. + */ + if( out ) + in = out; } /* If we are upsampling, don't sharpen, since nearest looks dumb