From: dirk Date: Tue, 6 Jan 2015 22:24:27 +0000 (+0000) Subject: Fixed off by one bug in AdaptiveThresholdImage. X-Git-Tag: 7.0.1-0~1486 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a608e0ac47949160708bb527cf6cfdb36d91497e;p=imagemagick Fixed off by one bug in AdaptiveThresholdImage. --- diff --git a/MagickCore/threshold.c b/MagickCore/threshold.c index 7a8b6f395..788e33ee6 100644 --- a/MagickCore/threshold.c +++ b/MagickCore/threshold.c @@ -321,7 +321,7 @@ MagickExport Image *AdaptiveThresholdImage(const Image *image, channel_bias[channel]+=pixels[i]; pixels+=(width-1)*GetPixelChannels(image); channel_sum[channel]+=pixels[i]; - pixels+=GetPixelChannels(image)*image->columns; + pixels+=GetPixelChannels(image)*(image->columns+1); } mean=(double) (channel_sum[channel]/number_pixels+bias); SetPixelChannel(threshold_image,channel,(Quantum) ((double)