Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/808
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Sep 30, 2017
1 parent a502238 commit 24d5699
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion coders/gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,14 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image,
colormap=(unsigned char *) AcquireQuantumMemory(768UL,sizeof(*colormap));
if ((global_colormap == (unsigned char *) NULL) ||
(colormap == (unsigned char *) NULL))
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
{
if (global_colormap != (unsigned char *) NULL)
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
if (colormap != (unsigned char *) NULL)
colormap=(unsigned char *) RelinquishMagickMemory(colormap);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
for (i=0; i < 768; i++)
colormap[i]=(unsigned char) 0;
/*
Expand Down

0 comments on commit 24d5699

Please sign in to comment.