Page 1 of 1

Bug of non termination due to floating-point rounding errors

Posted: 2017-03-02T08:43:59-07:00
by fmaurica
Bug of non termination due to floating-point rounding errors found in the following version of ImageMagick:

Code: Select all

$ convert -version
Version: ImageMagick 7.0.4-9 Q16 x86_64 2017-02-14 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP 
Delegates (built-in): png zlib
When launching the following command:

Code: Select all

$ convert flower.png -modulate 100,100,1E25 flower-mod.png
the following function in MagickCore/enhance.c does not terminate:

Code: Select all

static inline void ModulateHSL(const double percent_hue,const double percent_saturation,
                               const double percent_lightness,double *red,double *green,double *blue)
Same problem for the functions ModulateHCL, ModulateHCLp, ModulateHSB, ModulateHSI,
ModulateHSV, ModulateHWB, ModulateLCHab and ModulateLCHuv.
For example non termination of the function ModulateHCL when launching the following command:

Code: Select all

$ convert flower.png -define modulate:colorspace=HCL -modulate 100,100,1E25 flower-mod.png
Other versions of ImageMagick may also be affected.

Re: Bug of non termination due to floating-point rounding errors

Posted: 2017-03-03T10:16:18-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: Bug of non termination due to floating-point rounding errors

Posted: 2017-03-03T10:47:21-07:00
by fmaurica
You are welcome.