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

Index: ImageMagick-7.0.7-34/MagickCore/statistic.c
===================================================================
--- ImageMagick-7.0.7-34.orig/MagickCore/statistic.c	2020-12-08 17:29:23.303460291 +0100
+++ ImageMagick-7.0.7-34/MagickCore/statistic.c	2020-12-08 17:29:23.407461000 +0100
@@ -368,8 +368,12 @@ static double ApplyEvaluateOperator(Rand
     }
     case PowEvaluateOperator:
     {
-      result=(double) (QuantumRange*pow((double) (QuantumScale*pixel),(double)
-        value));
+      if (pixel < 0)
+        result=(double) -(QuantumRange*pow((double) -(QuantumScale*pixel),
+          (double) value));
+      else
+        result=(double) (QuantumRange*pow((double) (QuantumScale*pixel),
+          (double) value));
       break;
     }
     case RightShiftEvaluateOperator:
openSUSE Build Service is sponsored by