diff --git a/MagickCore/resample.c b/MagickCore/resample.c index e8b50a4f43..e35c595ab0 100644 --- a/MagickCore/resample.c +++ b/MagickCore/resample.c @@ -598,11 +598,11 @@ MagickExport MagickBooleanType ResamplePixelColor( weight = 0.0; #if FILTER_LUT /* Note that the ellipse has been pre-scaled so F = WLUT_WIDTH */ - if ((Q >= 0.0) && ((int) Q < WLUT_WIDTH)) { - weight = resample_filter->filter_lut[(int)Q]; + if (((int) Q >= 0) && ((int) Q < WLUT_WIDTH)) { + weight = resample_filter->filter_lut[(int) Q]; #else /* Note that the ellipse has been pre-scaled so F = support^2 */ - if ((Q >= 0.0) && (Q < (double)resample_filter->F)) { + if ((Q >= 0.0) && (Q < resample_filter->F)) { weight = GetResizeFilterWeight(resample_filter->filter_def, sqrt(Q)); /* a SquareRoot! Arrggghhhhh... */ #endif