Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/1450
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 20, 2019
1 parent 8a43abe commit 1e6a3ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions coders/pcd.c
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down

0 comments on commit 1e6a3ac

Please sign in to comment.