]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 14 Aug 2010 02:41:27 +0000 (02:41 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 14 Aug 2010 02:41:27 +0000 (02:41 +0000)
coders/psd.c

index 049b71d948825c12d779418c8303ada7d58498a8..8326a2e1b1f67d133e28567a521e730f78a8fbb4 100644 (file)
@@ -654,7 +654,8 @@ static MagickBooleanType ReadPSDLayer(Image *image,const size_t channels,
 
                   for (bit=0; bit < (image->columns % 8); bit++)
                   {
-                    indexes[x]=((pixel & (0x01 << (7-bit))) != 0 ? 0 : 255);
+                    indexes[x]=((((unsigned char) pixel) & (0x01 << (7-bit)))
+                      != 0 ? 0 : 255);
                     *q=image->colormap[(ssize_t) indexes[x]];
                     q->red=image->colormap[(ssize_t) indexes[x]].red;
                     q->green=image->colormap[(ssize_t) indexes[x]].green;