From: Cristy Date: Mon, 2 Oct 2017 11:31:48 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-6~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad350cbc7c2658105059b871c222abff0baea75a;p=imagemagick ... --- diff --git a/coders/tim.c b/coders/tim.c index 7cc0ae17e..851454fe3 100644 --- a/coders/tim.c +++ b/coders/tim.c @@ -201,7 +201,11 @@ static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); count=ReadBlob(image,2*image->colors,tim_colormap); if (count != (ssize_t) (2*image->colors)) - ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); + { + tim_colormap=(unsigned char *) RelinquishMagickMemory(tim_colormap); + ThrowReaderException(CorruptImageError, + "InsufficientImageDataInFile"); + } p=tim_colormap; for (i=0; i < (ssize_t) image->colors; i++) {