]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/121
authorCristy <urban-warrior@imagemagick.org>
Sat, 20 Feb 2016 14:26:04 +0000 (09:26 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 20 Feb 2016 14:26:04 +0000 (09:26 -0500)
coders/pdb.c

index b2c12cca5d7ba22d355c344cc1bd9df1533f7144..ab40dd86abcc8fccc2b2303ec09fd507838b49d9 100644 (file)
@@ -819,11 +819,11 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image,
     pdb_image.width=(short) (16*(image->columns/16+1));
   pdb_image.height=(short) image->rows;
   packets=((bits_per_pixel*image->columns+7)/8);
-  runlength=(unsigned char *) AcquireQuantumMemory(4UL*packets,
+  runlength=(unsigned char *) AcquireQuantumMemory(9UL*packets,
     image->rows*sizeof(*runlength));
   if (runlength == (unsigned char *) NULL)
     ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
-  buffer=(unsigned char *) AcquireQuantumMemory(2*256,sizeof(*buffer));
+  buffer=(unsigned char *) AcquireQuantumMemory(256,sizeof(*buffer));
   if (buffer == (unsigned char *) NULL)
     ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
   packet_size=(size_t) (image->depth > 8 ? 2: 1);