From: Cristy Date: Thu, 31 May 2018 11:34:32 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-38~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=544950b57b5aaa33283719de6388d84878611a4e;p=imagemagick ... --- diff --git a/ChangeLog b/ChangeLog index a76d349f4..14ddbe46e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 7.0.7-37 + * 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 * Release ImageMagick version 7.0.7-37, GIT revision 14393:61d7e8b17:20180529. diff --git a/MagickCore/draw.c b/MagickCore/draw.c index f6433e619..a54816cb6 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -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); \ } diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index d6cd885d3..3a0db63c3 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -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); }