From: Cristy Date: Sun, 20 Jan 2019 16:11:52 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/1450 X-Git-Tag: 7.0.8-25~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e6a3ace073c9ec9c71e439c111d23c6e66cb6ae;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1450 --- diff --git a/coders/pcd.c b/coders/pcd.c index 8eb8ac652..7e48c138c 100644 --- a/coders/pcd.c +++ b/coders/pcd.c @@ -204,6 +204,8 @@ static MagickBooleanType DecodeImage(Image *image,unsigned char *luma, if (pcd_table[i] == (PCDTable *) NULL) { buffer=(unsigned char *) RelinquishMagickMemory(buffer); + for (j=0; j < i; j++) + pcd_table[j]=(PCDTable *) RelinquishMagickMemory(pcd_table[j]); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } @@ -215,6 +217,8 @@ static MagickBooleanType DecodeImage(Image *image,unsigned char *luma, if (r->length > 16) { buffer=(unsigned char *) RelinquishMagickMemory(buffer); + for (j=0; j <= i; j++) + pcd_table[j]=(PCDTable *) RelinquishMagickMemory(pcd_table[j]); return(MagickFalse); } PCDGetBits(16);