From 7ede0be7c379b2a105cae9d9633727845d5458cc Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 24 Jun 2017 08:04:51 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/522 --- coders/dib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coders/dib.c b/coders/dib.c index 015c79882..fe7bf5da9 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -619,7 +619,10 @@ static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) packet_size=4; count=ReadBlob(image,packet_size*image->colors,dib_colormap); if (count != (ssize_t) (packet_size*image->colors)) - ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); + { + dib_colormap=(unsigned char *) RelinquishMagickMemory(dib_colormap); + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); + } p=dib_colormap; for (i=0; i < (ssize_t) image->colors; i++) { -- 2.40.0