File ImageMagick-CVE-2020-25674.patch of Package ImageMagick.30356

Index: ImageMagick-7.0.7-34/coders/png.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/png.c	2020-12-08 14:16:19.480633227 +0100
+++ ImageMagick-7.0.7-34/coders/png.c	2020-12-08 14:16:19.652634375 +0100
@@ -8985,7 +8985,7 @@ static MagickBooleanType WriteOnePNGImag
          (void) LogMagickEvent(CoderEvent,GetMagickModule(),
              "        i    (red,green,blue,alpha)");
 
-         for (i=0; i < 256; i++)
+         for (i=0; i < MagickMin(image->colors,256); i++)
          {
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                    "        %d    (%d,%d,%d,%d)",
openSUSE Build Service is sponsored by