]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Mon, 2 Oct 2017 11:31:48 +0000 (07:31 -0400)
committerCristy <urban-warrior@imagemagick.org>
Mon, 2 Oct 2017 11:31:48 +0000 (07:31 -0400)
coders/tim.c

index 7cc0ae17e8a09b57393d210287a482c126d06fae..851454fe3f27928ba059378f40b0c88d1d47189b 100644 (file)
@@ -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++)
         {