File ImageMagick-CVE-2020-27771.patch of Package ImageMagick.30356
Index: ImageMagick-7.0.7-34/coders/pdf.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/pdf.c 2020-12-07 10:45:51.509325416 +0100
+++ ImageMagick-7.0.7-34/coders/pdf.c 2020-12-07 10:45:51.673326344 +0100
@@ -2158,7 +2158,7 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- *q++=(unsigned char) GetPixelIndex(image,p);
+ *q++=(unsigned char) ((ssize_t) GetPixelIndex(image,p));
p+=GetPixelChannels(image);
}
if (image->previous == (Image *) NULL)
@@ -2200,7 +2200,8 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- Ascii85Encode(image,(unsigned char) GetPixelIndex(image,p));
+ Ascii85Encode(image,(unsigned char) ((ssize_t)
+ GetPixelIndex(image,p)));
p+=GetPixelChannels(image);
}
if (image->previous == (Image *) NULL)
@@ -2675,7 +2676,7 @@ RestoreMSCWarning
break;
for (x=0; x < (ssize_t) tile_image->columns; x++)
{
- *q++=(unsigned char) GetPixelIndex(tile_image,p);
+ *q++=(unsigned char) ((ssize_t) GetPixelIndex(tile_image,p));
p+=GetPixelChannels(tile_image);
}
}
@@ -2712,7 +2713,7 @@ RestoreMSCWarning
for (x=0; x < (ssize_t) tile_image->columns; x++)
{
Ascii85Encode(image,(unsigned char)
- GetPixelIndex(tile_image,p));
+ ((ssize_t) GetPixelIndex(tile_image,p)));
p+=GetPixelChannels(image);
}
}