From 9c9a84cec4ab28ee0b57c2b9266d6fbe68183512 Mon Sep 17 00:00:00 2001 From: xiaoxiaoafeifei Date: Sat, 19 Mar 2022 18:50:38 +0800 Subject: [PATCH] fix issue: outside the range of representable values of type 'unsigned int' at coders/psd.c:1025 (#4963) * fix Division by zero in XMenuWidget() of MagickCore/widget.c * Fix memory leak in AnimateImageCommand() of MagickWand/animate.c and DisplayImageCommand() of MagickWand/display.c * fix Division by zero in ReadEnhMetaFile() of coders/emf.c * Resolve conflicts * fix issue: outside the range of representable values of type 'unsigned char' at coders/psd.c:1025 Co-authored-by: zhailiangliang --- coders/psd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coders/psd.c b/coders/psd.c index f98f2bb088b..76e1bf7a3d9 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -1022,7 +1022,7 @@ static MagickBooleanType ReadPSDChannelPixels(Image *image,const ssize_t row, number_bits=8; for (bit = 0; bit < (ssize_t) number_bits; bit++) { - SetPSDPixel(image,channel,packet_size,(((unsigned char) pixel) + SetPSDPixel(image,channel,packet_size,(((unsigned char)((ssize_t)pixel)) & (0x01 << (7-bit))) != 0 ? 0 : QuantumRange,q,exception); q+=GetPixelChannels(image); x++;