don't use isnormal() to test for crazy FP numbers
it fails for 0.0 and for subnormal numbers, thanks Murat Korkmazov
This commit is contained in:
parent
9d8080c266
commit
0c466b9495
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user