From 69d1a3c923fa304656277ad13eb05e090bfecddc Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 16 Dec 2014 19:01:55 +0000 Subject: [PATCH] --- MagickCore/colormap-private.h | 5 ++--- coders/palm.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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, -- 2.50.1