File ImageMagick-CVE-2020-27761.patch of Package ImageMagick.30356
Index: ImageMagick-7.0.7-34/coders/palm.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/palm.c 2020-12-04 12:18:24.118170052 +0100
+++ ImageMagick-7.0.7-34/coders/palm.c 2020-12-04 12:18:24.146170223 +0100
@@ -902,10 +902,10 @@ static MagickBooleanType WritePALMImage(
{
for (x=0; x < (ssize_t) image->columns; x++)
{
- color16=(unsigned short) ((((31*(size_t) GetPixelRed(image,p))/
- (size_t) QuantumRange) << 11) | (((63*(size_t)
- GetPixelGreen(image,p))/(size_t) QuantumRange) << 5) |
- ((31*(size_t) GetPixelBlue(image,p))/(size_t) QuantumRange));
+ color16=(unsigned short) ((((31*(ssize_t) GetPixelRed(image,p))/
+ (ssize_t) QuantumRange) << 11) | (((63*(ssize_t)
+ GetPixelGreen(image,p))/(ssize_t) QuantumRange) << 5) |
+ ((31*(ssize_t) GetPixelBlue(image,p))/(ssize_t) QuantumRange));
if (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)
{
transpix.red=(MagickRealType) GetPixelRed(image,p);