]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1714
authorCristy <urban-warrior@imagemagick.org>
Fri, 4 Oct 2019 22:21:02 +0000 (18:21 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 4 Oct 2019 22:21:02 +0000 (18:21 -0400)
coders/palm.c

index c8a85d83cc435fe8bcaa45e16d3724ef89eb5557..bcaf285db2e6e4556341856f20f24e2f8f4e60a1 100644 (file)
@@ -771,7 +771,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
   {
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     count=GetNumberColors(image,NULL,exception);
-    for (bits_per_pixel=1;  (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
+    for (bits_per_pixel=1; (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
     if (bits_per_pixel > 16)
       bits_per_pixel=16;
     else
@@ -876,7 +876,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
     last_row=(unsigned char *) NULL;
     if (image_info->compression == FaxCompression)
       {
-        last_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row,
+        last_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row+256,
           sizeof(*last_row));
         if (last_row == (unsigned char *) NULL)
           {
@@ -884,7 +884,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
             ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
           }
       }
-    one_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row,
+    one_row=(unsigned char *) AcquireQuantumMemory(bytes_per_row+256,
       sizeof(*one_row));
     if (one_row == (unsigned char *) NULL)
       {