From a26d35af096de6cda7988276cd5307f9d21c5bca Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 15 Aug 2017 07:51:23 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/676 --- coders/miff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coders/miff.c b/coders/miff.c index 8b2e2e321..7e019a00a 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -1087,7 +1087,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, (image->columns == 0) || (image->rows == 0)) { if (image->previous == (Image *) NULL) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + { + if (profiles != (LinkedListInfo *) NULL) + profiles=DestroyLinkedList(profiles,RelinquishMagickMemory); + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + } DeleteImageFromList(&image); (void) ThrowMagickException(exception,GetMagickModule(), CorruptImageError,"ImproperImageHeader","`%s'",image->filename); -- 2.50.1