Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Jan 11, 2017
1 parent d4ec73f commit 66e283e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2017-01-10 7.0.4-4 Cristy <quetzlzacatenango@image...>
* Recognize XML policy closing tags (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31182).
* Fix memory leak in the MPC format.

2017-01-07 7.0.4-3 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.4-3, GIT revision 19329:930ca78:20170107.
Expand Down
11 changes: 7 additions & 4 deletions coders/mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "MagickCore/profile.h"
#include "MagickCore/property.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/resource.h"
#include "MagickCore/static.h"
#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
Expand Down Expand Up @@ -834,7 +835,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
/*
Create image colormap.
*/
if (AcquireImageColormap(image,image->colors,exception) == MagickFalse)
image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors+1,
sizeof(*image->colormap));
if (image->colormap == (PixelInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
if (image->colors != 0)
{
Expand Down Expand Up @@ -923,9 +926,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
if (image->scene >= (image_info->scene+image_info->number_scenes-1))
break;
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
return(DestroyImageList(image));
if ((AcquireMagickResource(WidthResource,image->columns) == MagickFalse) ||
(AcquireMagickResource(HeightResource,image->rows) == MagickFalse))
ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
/*
Attach persistent pixel cache.
*/
Expand Down

0 comments on commit 66e283e

Please sign in to comment.