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
This commit is contained in:
John Cupitt 2015-10-02 15:44:18 +01:00
parent a67c1d6d57
commit f1802ade84
1 changed files with 2 additions and 1 deletions

View File

@ -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.
*/