From: cristy Date: Sat, 17 May 2014 14:36:40 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2332 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71cd76fb2c14482f151189e83adbeadd56d8e61e;p=imagemagick --- diff --git a/MagickCore/colormap.c b/MagickCore/colormap.c index e5b53e206..ccf53f494 100644 --- a/MagickCore/colormap.c +++ b/MagickCore/colormap.c @@ -131,14 +131,18 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, image->colormap=(PixelInfo *) ResizeQuantumMemory(image->colormap, image->colors,sizeof(*image->colormap)); if (image->colormap == (PixelInfo *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); + { + image->colors=0; + image->storage_class=DirectClass; + ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", + image->filename); + } for (i=0; i < (ssize_t) image->colors; i++) { double pixel; - pixel=(double) (i*(QuantumRange/MagickMax(colors-1,1))); + pixel=(double) (i*(QuantumRange/(image->colors-1))); GetPixelInfo(image,image->colormap+i); image->colormap[i].alpha_trait=BlendPixelTrait; image->colormap[i].red=pixel;