File ImageMagick-CVE-2022-0284.patch of Package ImageMagick.27740
Index: ImageMagick-7.1.0-9/coders/xpm.c
===================================================================
--- ImageMagick-7.1.0-9.orig/coders/xpm.c 2021-10-03 17:03:57.000000000 +0200
+++ ImageMagick-7.1.0-9/coders/xpm.c 2022-02-08 15:05:56.492427715 +0100
@@ -777,7 +777,7 @@ static MagickBooleanType WritePICONImage
break;
for (x=0; x < (ssize_t) picon->columns; x++)
{
- if (GetPixelAlpha(image,q) == (Quantum) TransparentAlpha)
+ if (GetPixelAlpha(picon,q) == (Quantum) TransparentAlpha)
transparent=MagickTrue;
else
SetPixelAlpha(picon,OpaqueAlpha,q);
@@ -808,7 +808,7 @@ static MagickBooleanType WritePICONImage
break;
for (x=0; x < (ssize_t) picon->columns; x++)
{
- if (GetPixelAlpha(image,q) == (Quantum) TransparentAlpha)
+ if (GetPixelAlpha(picon,q) == (Quantum) TransparentAlpha)
SetPixelIndex(picon,(Quantum) picon->colors,q);
q+=GetPixelChannels(picon);
}