Fix 'pow' macros in pngvalid.c

It is legal for 'pow' to be a macro, therefore the argument list cannot contain
preprocessing directives.  Make sure pow is a function where this happens (this
is a minimal safe fix, the issue only arises in non-performance-critical code.)

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler 2015-10-03 11:08:03 -07:00
parent 2cd6d56ff6
commit 13ce05daaf

View File

@ -7158,7 +7158,7 @@ image_transform_png_set_rgb_to_gray_ini(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 += pow(
that->pm->limit += (pow)(
# if PNG_MAX_GAMMA_8 < 14
(that->this.bit_depth == 16 ? 8. :
6. + (1<<(15-PNG_MAX_GAMMA_8)))
@ -7182,7 +7182,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
* affects the limit used for checking for internal calculation errors,
* not the actual limit imposed by pngvalid on the output errors.
*/
that->pm->limit += pow(
that->pm->limit += (pow)(
# if DIGITIZE
1.3
# else