File ImageMagick-CVE-2022-0284.patch of Package ImageMagick.18189

Index: ImageMagick-7.0.7-34/coders/xpm.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/xpm.c	2022-02-08 15:21:57.258034731 +0100
+++ ImageMagick-7.0.7-34/coders/xpm.c	2022-02-08 15:21:57.546036411 +0100
@@ -737,7 +737,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);
@@ -764,7 +764,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);
         }
openSUSE Build Service is sponsored by