From f1802ade84bf15c92bf7326925a19c0b23d7f209 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 2 Oct 2015 15:44:18 +0100 Subject: [PATCH] fix a segv with small images and tiff pyr images smaller than a tile would crash the tiff writer in pyramid mode see https://github.com/jcupitt/libvips/issues/333 --- libvips/foreign/vips2tiff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index 1159c019..676d9d22 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -1587,7 +1587,8 @@ vips__tiff_write( VipsImage *in, const char *filename, * not delete) the smaller layers ready for us to read from * them again. */ - pyramid_free( write->layer->below ); + if( write->layer->below ) + pyramid_free( write->layer->below ); /* Append smaller layers to the main file. */