From 78d9987ae80a95865c9f139afde0dcf3fd832ddc Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 9 Oct 2019 19:34:55 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1737

---
 magick/statistic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/magick/statistic.c b/magick/statistic.c
index 87a9a42f4..2db7c858f 100644
--- a/magick/statistic.c
+++ b/magick/statistic.c
@@ -353,8 +353,12 @@ static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
     }
     case PowEvaluateOperator:
     {
-      result=(MagickRealType) (QuantumRange*pow((double) (QuantumScale*pixel),
-        (double) value));
+      if (pixel < 0)
+        result=(MagickRealType) -(QuantumRange*pow((double) -(QuantumScale*
+          pixel),(double) value));
+      else
+        result=(MagickRealType) (QuantumRange*pow((double) (QuantumScale*pixel),
+          (double) value));
       break;
     }
     case RightShiftEvaluateOperator:
