]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 1 Oct 2017 13:32:15 +0000 (09:32 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 1 Oct 2017 13:32:15 +0000 (09:32 -0400)
coders/sun.c

index b485f74ed06d76f22966d09e54fa8c1f0440e282..50efc0d560a423a5b31d4c3d9010e26fec0f8e25 100644 (file)
@@ -481,7 +481,11 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
       {
         status=DecodeImage(sun_data,sun_info.length,sun_pixels,pixels_length);
         if (status == MagickFalse)
-          ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+          {
+            sun_data=(unsigned char *) RelinquishMagickMemory(sun_data);
+            sun_pixels=(unsigned char *) RelinquishMagickMemory(sun_pixels);
+            ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+          }
       }
     else
       {