From ad7765b78e19ab75f509de8e6effce25c362a750 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 21 Feb 2017 12:29:58 -0500 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31438 --- MagickCore/colormap.c | 3 ++- coders/mpc.c | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MagickCore/colormap.c b/MagickCore/colormap.c index 893c65592..b9e639b49 100644 --- a/MagickCore/colormap.c +++ b/MagickCore/colormap.c @@ -128,6 +128,7 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } + image->storage_class=PseudoClass; for (i=0; i < (ssize_t) image->colors; i++) { double @@ -141,7 +142,7 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, image->colormap[i].blue=pixel; image->colormap[i].alpha=OpaqueAlpha; } - return(SetImageStorageClass(image,PseudoClass,exception)); + return(MagickTrue); } /* diff --git a/coders/mpc.c b/coders/mpc.c index 3a85d5597..6fd18486b 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -850,9 +850,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Create image colormap. */ - image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors+1, - sizeof(*image->colormap)); - if (image->colormap == (PixelInfo *) NULL) + if (AcquireImageColormap(image,image->colors) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); if (image->colors != 0) { -- 2.40.0