From: Cristy Date: Sat, 20 Feb 2016 14:26:04 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/121 X-Git-Tag: 7.0.1-0~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b93db1807ef8abf0c81df8b0fd047e5fb3f1c3f;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/121 --- diff --git a/coders/pdb.c b/coders/pdb.c index b2c12cca5..ab40dd86a 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -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);