]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/561
authorCristy <urban-warrior@imagemagick.org>
Sun, 16 Jul 2017 15:18:07 +0000 (11:18 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 16 Jul 2017 15:18:07 +0000 (11:18 -0400)
coders/ps.c

index db2260c32dc5ef989db737cbedbcc91ca603352f..cf1eaf46fdbf827a9a8ae35d6c4652469dd1be6b 100644 (file)
@@ -1153,7 +1153,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image,
 {
 #define WriteRunlengthPacket(image,pixel,length,p) \
 { \
-  if ((image->alpha_trait != UndefinedPixelTrait) && \
+  if ((image->alpha_trait != UndefinedPixelTrait) && (length != 0) && \
       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
     { \
       q=PopHexPixel(hex_digits,0xff,q); \
@@ -1999,8 +1999,8 @@ RestoreMSCWarning
           /*
             Dump DirectClass image.
           */
-          (void) FormatLocaleString(buffer,MagickPathExtent,"%.20g %.20g\n0\n%d\n",
-            (double) image->columns,(double) image->rows,
+          (void) FormatLocaleString(buffer,MagickPathExtent,
+            "%.20g %.20g\n0\n%d\n",(double) image->columns,(double) image->rows,
             compression == RLECompression ? 1 : 0);
           (void) WriteBlobString(image,buffer);
           switch (compression)