]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/376
authorCristy <urban-warrior@imagemagick.org>
Wed, 8 Feb 2017 18:37:13 +0000 (13:37 -0500)
committerCristy <urban-warrior@imagemagick.org>
Wed, 8 Feb 2017 18:37:13 +0000 (13:37 -0500)
https://github.com/ImageMagick/ImageMagick/issues/375

MagickCore/image.c
coders/sun.c

index 6e8f6910e8621d291d497fab191abe13a18e02f3..30bf4b85db631bb169e4da538bd8aea775a7184f 100644 (file)
@@ -4046,6 +4046,8 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info,
     into per-image artifacts, while ensuring only specifically set per-image
     artifacts are preserved when parenthesis ends.
   */
+  if (image->image_info != (ImageInfo *) NULL)
+    image->image_info=DestroyImageInfo(image->image_info);
   image->image_info=CloneImageInfo(image_info);
   return(MagickTrue);
 }
index 3c0cb386430e31f2899309b16e2c04f9a0e58388..33e7c3fe8b4e4f536410ca603ba1a28b9927e534 100644 (file)
@@ -456,7 +456,7 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
         ThrowReaderException(ResourceLimitError,"ImproperImageHeader");
       }
     pixels_length=height*bytes_per_line;
-    sun_pixels=(unsigned char *) AcquireQuantumMemory(pixels_length,
+    sun_pixels=(unsigned char *) AcquireQuantumMemory(pixels_length+image->rows,
       sizeof(*sun_pixels));
     if (sun_pixels == (unsigned char *) NULL)
       {