Skip to content

Commit

Permalink
fix issue: outside the range of representable values of type 'unsigne…
Browse files Browse the repository at this point in the history
…d 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 <zhailiangliang@loongson.cn>
  • Loading branch information
xiaoxiaoafeifei and xiaoxiaoafeifei committed Mar 19, 2022
1 parent 8ed4f9a commit 9c9a84c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coders/psd.c
Expand Up @@ -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++;
Expand Down

0 comments on commit 9c9a84c

Please sign in to comment.