From: anthony Date: Fri, 11 May 2012 02:23:39 +0000 (+0000) Subject: Added sanity checks to EWA resampling X-Git-Tag: 7.0.1-0~5618 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d2553e6f4849f937e3b32fcac096a23932a6f64;p=imagemagick Added sanity checks to EWA resampling --- diff --git a/MagickCore/resample.c b/MagickCore/resample.c index 5d7af2f81..f30b4a61c 100644 --- a/MagickCore/resample.c +++ b/MagickCore/resample.c @@ -645,8 +645,9 @@ MagickExport MagickBooleanType ResamplePixelColor( /* Result sanity check -- this should NOT happen */ - if ( hit == 0 ) { - /* not enough pixels in resampling, resort to direct interpolation */ + if ( hit == 0 || divisor_m <= MagickEpsilon || divisor_c <= MagickEpsilon ) { + /* not enough pixels, or bad weighting in resampling, + resort to direct interpolation */ #if DEBUG_NO_PIXEL_HIT pixel->alpha = pixel->red = pixel->green = pixel->blue = 0; pixel->red = QuantumRange; /* show pixels for which EWA fails */