From 21f37037fac7d90cf529bf4fbc3137b60b028142 Mon Sep 17 00:00:00 2001 From: Daniel Dennedy Date: Mon, 7 Dec 2020 14:29:10 -0800 Subject: [PATCH] fix heif load fails with 0 length metadata fixes #1901 --- libvips/foreign/heifload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvips/foreign/heifload.c b/libvips/foreign/heifload.c index 0e99b337..aba2efab 100644 --- a/libvips/foreign/heifload.c +++ b/libvips/foreign/heifload.c @@ -467,6 +467,8 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) printf( "metadata type = %s, length = %zu\n", type, length ); #endif /*DEBUG*/ + if( !length ) + continue; if( !(data = VIPS_ARRAY( out, length, unsigned char )) ) return( -1 ); error = heif_image_handle_get_metadata(