From: nicolas Date: Tue, 11 Dec 2012 15:27:48 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~4623 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=564e05ecd66ac304817909c9ed31a6eca3a71714;p=imagemagick --- diff --git a/MagickCore/resample.c b/MagickCore/resample.c index e3477ddc3..a72b58bd4 100644 --- a/MagickCore/resample.c +++ b/MagickCore/resample.c @@ -894,6 +894,11 @@ static inline void ClampUpAxes(const double dux,const double dvx, const double frobenius_squared = n11+n22; const double discriminant = (frobenius_squared+twice_det)*(frobenius_squared-twice_det); + /* + * In exact arithmetic, discriminant can't be negative. In floating + * point, it can, because of the bad conditioning of SVD + * decompositions done through the associated normal matrix. + */ const double sqrt_discriminant = sqrt(discriminant > 0.0 ? discriminant : 0.0); /*