Hello,
I use ImageMagick 6.4.2-6 and I wometime get a divided by zero exception due to the monitor handler.
It occurs in the QuantumTick inline method (monitor.h) when span = 100.
I correct the code below:
static inline MagickBooleanType QuantumTick(const MagickOffsetType offset,
const MagickSizeType span)
{
if (span <= 100) // Instead span < 100
return(MagickTrue);
if ((offset % ((span-1)/100)) == 0) // Exception if span=100 => ((offset % (99/100)) and 99/100 is egal to zero
return(MagickTrue);
if (offset == (MagickOffsetType) (span-1))
return(MagickTrue);
return(MagickFalse);
}
Thanks you!
Divided by zero exception in ProgressMonitor
Divided by zero exception in ProgressMonitor
Manuel Jouglet
Mootools
Mootools
Re: Divided by zero exception in ProgressMonitor
Thank you for the patch. We have corrected the problem in the ImageMagick subversion trunk.