Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/549
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jul 8, 2017
1 parent 7beec9a commit d9ccd82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions coders/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -4384,6 +4384,8 @@ static Image *ReadOneJNGImage(MngInfo *mng_info,

if (length != 0)
{
if (length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
chunk=(unsigned char *) AcquireQuantumMemory(length+MagickPathExtent,
sizeof(*chunk));

Expand Down Expand Up @@ -5260,12 +5262,14 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info,

if (length != 0)
{
if (length > GetBlobSize(image))
ThrowReaderException(CorruptImageError,
"InsufficientImageDataInFile");
chunk=(unsigned char *) AcquireQuantumMemory(length+
MagickPathExtent,sizeof(*chunk));

if (chunk == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,
"MemoryAllocationFailed");
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");

for (i=0; i < (ssize_t) length; i++)
{
Expand Down

0 comments on commit d9ccd82

Please sign in to comment.