From 8c69a644b1a32dd032541d123d232003f05887f8 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 8 Jan 2019 23:07:32 +0100 Subject: [PATCH] Call SetImageExtent to make sure the new width and height are allowed and the pixel cache is synchronized. --- coders/heic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coders/heic.c b/coders/heic.c index a27d53ea5..534e47bf4 100644 --- a/coders/heic.c +++ b/coders/heic.c @@ -301,9 +301,11 @@ static Image *ReadHEICImage(const ImageInfo *image_info, /* Correct the width and height of the image */ image->columns=(size_t) heif_image_get_width(heif_image,heif_channel_Y); image->rows=(size_t) heif_image_get_height(heif_image,heif_channel_Y); + status=SetImageExtent(image,image->columns,image->rows,exception); heif_decoding_options_free(decode_options); } - if (IsHeifSuccess(&error,image,exception) == MagickFalse) + if ((IsHeifSuccess(&error,image,exception) == MagickFalse) || + (status == MagickFalse)) { heif_image_handle_release(image_handle); heif_context_free(heif_context); -- 2.40.0