diff --git a/ChangeLog b/ChangeLog index b7774e22..98767845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ - add VInterpolate class to cplusplus binding, thanks Lovell - add lower-level operation cache access - turn on leak testing in test suite +- don't use isnormal() to test for crazy FP numbers, thanks Murat 24/12/14 started 7.42.1 - add gobject-2.0 to Requires: in vips and vips-cpp .pc files diff --git a/libvips/colour/LabQ2sRGB.c b/libvips/colour/LabQ2sRGB.c index 461ee8fb..12d9b604 100644 --- a/libvips/colour/LabQ2sRGB.c +++ b/libvips/colour/LabQ2sRGB.c @@ -269,10 +269,13 @@ vips_col_scRGB2sRGB( int range, int *lut, /* XYZ can be Nan, Inf etc. Throw those values out, they will break * our clipping. + * + * Don't use isnormal(), it is false for 0.0 and for subnormal + * numbers. */ - if( !isnormal( R ) || - !isnormal( G ) || - !isnormal( B ) ) { + if( isnan( R ) || isinf( R ) || + isnan( G ) || isinf( G ) || + isnan( B ) || isinf( B ) ) { *r = 0; *g = 0; *b = 0;