Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/577
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jul 17, 2017
1 parent bd40cc5 commit c1b09bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion coders/pict.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,16 @@ static MagickBooleanType WritePICTImage(const ImageInfo *image_info,
if ((buffer == (unsigned char *) NULL) ||
(packed_scanline == (unsigned char *) NULL) ||
(scanline == (unsigned char *) NULL))
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
{
if (scanline != (unsigned char *) NULL)
scanline=(unsigned char *) RelinquishMagickMemory(scanline);
if (packed_scanline != (unsigned char *) NULL)
packed_scanline=(unsigned char *) RelinquishMagickMemory(
packed_scanline);
if (buffer != (unsigned char *) NULL)
buffer=(unsigned char *) RelinquishMagickMemory(buffer);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
(void) ResetMagickMemory(scanline,0,row_bytes);
(void) ResetMagickMemory(packed_scanline,0,(size_t) (row_bytes+MaxCount));
/*
Expand Down

0 comments on commit c1b09bb

Please sign in to comment.