From: cristy Date: Tue, 16 Dec 2014 19:01:55 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69d1a3c923fa304656277ad13eb05e090bfecddc;p=imagemagick --- diff --git a/MagickCore/colormap-private.h b/MagickCore/colormap-private.h index 234458328..f54c50a09 100644 --- a/MagickCore/colormap-private.h +++ b/MagickCore/colormap-private.h @@ -26,11 +26,10 @@ extern "C" { #endif -static inline ssize_t ConstrainColormapIndex(Image *image,const size_t index, +static inline ssize_t ConstrainColormapIndex(Image *image,const ssize_t index, ExceptionInfo *exception) { - if ((index < 0) || (index >= (ssize_t) image->colors) || - ((ssize_t) index < 0)) + if ((index < 0) || (index >= (ssize_t) image->colors)) { (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError, "InvalidColormapIndex","`%s'",image->filename); diff --git a/coders/palm.c b/coders/palm.c index 3caf1363d..9396ee5a2 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -519,8 +519,8 @@ static Image *ReadPALMImage(const ImageInfo *image_info, } if (flags & PALM_HAS_TRANSPARENCY_FLAG) { - ssize_t index=ConstrainColormapIndex(image,(mask-transparentIndex), - exception); + ssize_t index=ConstrainColormapIndex(image,(ssize_t) (mask- + transparentIndex),exception); if (bits_per_pixel != 16) transpix=image->colormap[index]; (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha,