diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 622bdeb7a..7a5d3e316 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -6776,11 +6776,12 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this, * conversion adds another +/-2 in the 16-bit case and * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case. */ + that->pm->limit += # if PNG_MAX_GAMMA_8 < 14 - that->pm->limit += pow((that->this.bit_depth == 16 ? 8. : + pow((that->this.bit_depth == 16 ? 8. : 6. + (1<<(15-PNG_MAX_GAMMA_8)))/65535, data.gamma); # else - that->pm->limit += pow((that->this.bit_depth == 16 ? 8. : + pow((that->this.bit_depth == 16 ? 8. : 8. + (1<<(15-PNG_MAX_GAMMA_8)))/65535, data.gamma); # endif } @@ -6800,10 +6801,11 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this, * internal calculation errors, not the actual limit imposed by * pngvalid on the output errors. */ + that->pm->limit += # if DIGITIZE - that->pm->limit += pow(1.1 /255, data.gamma); + pow(1.1 /255, data.gamma); # else - that->pm->limit += pow(1.0 /255, data.gamma); + pow(1.0 /255, data.gamma); # endif } }