Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/550
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jul 8, 2017
1 parent 91e0724 commit c9aa9f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion coders/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -4377,7 +4377,13 @@ static Image *ReadOneJNGImage(MngInfo *mng_info,
type[0],type[1],type[2],type[3],(double) length);

if (length > PNG_UINT_31_MAX || count == 0)
ThrowReaderException(CorruptImageError,"CorruptImage");
{
if (color_image != (Image *) NULL)
color_image=DestroyImage(color_image);
if (color_image_info != (Image *) NULL)
color_image_info=DestroyImageInfo(color_image_info);
ThrowReaderException(CorruptImageError,"CorruptImage");
}

p=NULL;
chunk=(unsigned char *) NULL;
Expand Down

0 comments on commit c9aa9f8

Please sign in to comment.