From 7b93db1807ef8abf0c81df8b0fd047e5fb3f1c3f Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 20 Feb 2016 09:26:04 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/121 --- coders/pdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.40.0