]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Thu, 31 May 2018 11:34:32 +0000 (07:34 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 31 May 2018 11:34:32 +0000 (07:34 -0400)
ChangeLog
MagickCore/draw.c
MagickCore/enhance.c

index a76d349f403310ef89d0e4d394a6fe4c39e70b09..14ddbe46ee9fd34592b4190531ea3c361322e27b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-30  7.0.7-37  <quetzlzacatenango@image...>
+  * Heap buffer overflow fix (reference
+    https://github.com/ImageMagick/ImageMagick/issues/1156).
+  * Boundary issues with -gamma option when HDRI is enabled (reference
+    https://github.com/ImageMagick/ImageMagick/issues/1151).
+
 2018-05-29  7.0.7-37 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.7-37, GIT revision 14393:61d7e8b17:20180529.
 
index f6433e619ef91eb0f058ec8b2a6c6efb913cc83c..a54816cb66e45f68572b148be00dbcfbe962ab10 100644 (file)
@@ -419,13 +419,9 @@ static int CompareEdges(const void *p_edge,const void *q_edge)
 {
 #define DrawCompareEdge(p,q) \
 { \
-  double \
-    delta; \
- \
-  delta=(p)-(q); \
-  if (delta < 0.0) \
+  if (((p)-(q)) < 0.0) \
     return(-1); \
-  if (delta > 0.0) \
+  if (((p)-(q)) > 0.0) \
     return(1); \
 }
 
index d6cd885d3e1824ae6da68001fefc477eea6b7a42..3a0db63c337298f2ff0f2763de7accd3049efb0a 100644 (file)
@@ -1813,7 +1813,6 @@ MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
       /*
         Gamma-correct colormap.
       */
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
       if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
         image->colormap[i].red=(double) gamma_map[ScaleQuantumToMap(
           ClampToQuantum(image->colormap[i].red))];
@@ -1826,20 +1825,6 @@ MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
       if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
         image->colormap[i].alpha=(double) gamma_map[ScaleQuantumToMap(
           ClampToQuantum(image->colormap[i].alpha))];
-#else
-      if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-        image->colormap[i].red=QuantumRange*gamma_pow(QuantumScale*
-          image->colormap[i].red,1.0/gamma);
-      if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-        image->colormap[i].green=QuantumRange*gamma_pow(QuantumScale*
-          image->colormap[i].green,1.0/gamma);
-      if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-        image->colormap[i].blue=QuantumRange*gamma_pow(QuantumScale*
-          image->colormap[i].blue,1.0/gamma);
-      if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-        image->colormap[i].alpha=QuantumRange*gamma_pow(QuantumScale*
-          image->colormap[i].alpha,1.0/gamma);
-#endif
     }
   /*
     Gamma-correct image.
@@ -1878,11 +1863,7 @@ MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
         PixelTrait traits = GetPixelChannelTraits(image,channel);
         if ((traits & UpdatePixelTrait) == 0)
           continue;
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
-        q[j]=gamma_map[ScaleQuantumToMap(q[j])];
-#else
-        q[j]=QuantumRange*gamma_pow(QuantumScale*q[j],1.0/gamma);
-#endif
+        q[j]=gamma_map[ScaleQuantumToMap(ClampToQuantum(q[j]))];
       }
       q+=GetPixelChannels(image);
     }