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

Index: ImageMagick-7.0.7-34/MagickCore/enhance.c
===================================================================
--- ImageMagick-7.0.7-34.orig/MagickCore/enhance.c	2020-12-04 10:01:00.499815906 +0100
+++ ImageMagick-7.0.7-34/MagickCore/enhance.c	2020-12-04 10:01:00.919818583 +0100
@@ -1806,7 +1806,7 @@ MagickExport MagickBooleanType GammaImag
   if (gamma != 0.0)
     for (i=0; i <= (ssize_t) MaxMap; i++)
       gamma_map[i]=ScaleMapToQuantum((double) (MaxMap*pow((double) i/
-        MaxMap,1.0/gamma)));
+        MaxMap,PerceptibleReciprocal(gamma))));
   if (image->storage_class == PseudoClass)
     for (i=0; i < (ssize_t) image->colors; i++)
     {
@@ -2347,7 +2347,7 @@ static inline double LevelPixel(const do
 
   scale=PerceptibleReciprocal(white_point-black_point);
   level_pixel=QuantumRange*gamma_pow(scale*((double) pixel-black_point),
-    1.0/gamma);
+    PerceptibleReciprocal(gamma));
   return(level_pixel);
 }
 
openSUSE Build Service is sponsored by