From f853cfe464342ce571db9afce0a6134ffb89e943 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 23 Dec 2020 19:24:53 +0000 Subject: [PATCH] fix an assert fail with libheif 1.10 if you built heifload with DEBUG it could ask for bpp for channels which do not exist, triggering an assert fail in libheif 1.10 --- libvips/foreign/heifload.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvips/foreign/heifload.c b/libvips/foreign/heifload.c index 777497e6..2d61d74c 100644 --- a/libvips/foreign/heifload.c +++ b/libvips/foreign/heifload.c @@ -833,6 +833,9 @@ vips_foreign_load_heif_generate( VipsRegion *or, printf( "vips_foreign_load_heif_generate:\n" ); for( i = 0; i < VIPS_NUMBER( channel ); i++ ) { + if( !heif_image_has_channel( heif->img, channel[i] ) ) + continue; + printf( "\t%s:\n", channel_name[i] ); printf( "\t\twidth = %d\n", heif_image_get_width( heif->img,