diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-08-03 16:49:33 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2004-08-03 16:49:33 (GMT) |
commit | 6e8975abdb6b52477a5788bca969e13e467814dd (patch) | |
tree | 947221d2f202d586f7f386c57472cc941980963f /libpng | |
parent | e305d80490e1fb2dc15eb9cf9ee13428936c8e16 (diff) | |
download | Doxygen-6e8975abdb6b52477a5788bca969e13e467814dd.zip Doxygen-6e8975abdb6b52477a5788bca969e13e467814dd.tar.gz Doxygen-6e8975abdb6b52477a5788bca969e13e467814dd.tar.bz2 |
Release-1.3.8-20040803
Diffstat (limited to 'libpng')
-rw-r--r-- | libpng/pngrutil.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/libpng/pngrutil.c b/libpng/pngrutil.c index dca7c65..e9dc1a4 100644 --- a/libpng/pngrutil.c +++ b/libpng/pngrutil.c @@ -790,16 +790,18 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #endif #if defined(PNG_READ_sRGB_SUPPORTED) +#undef png_abs +#define png_abs(x) (((x)>0)?(x):-(x)) if (info_ptr->valid & PNG_INFO_sRGB) { - if (abs(int_x_white - 31270L) > 1000 || - abs(int_y_white - 32900L) > 1000 || - abs(int_x_red - 64000L) > 1000 || - abs(int_y_red - 33000L) > 1000 || - abs(int_x_green - 30000L) > 1000 || - abs(int_y_green - 60000L) > 1000 || - abs(int_x_blue - 15000L) > 1000 || - abs(int_y_blue - 6000L) > 1000) + if (png_abs(int_x_white - 31270L) > 1000 || + png_abs(int_y_white - 32900L) > 1000 || + png_abs(int_x_red - 64000L) > 1000 || + png_abs(int_y_red - 33000L) > 1000 || + png_abs(int_x_green - 30000L) > 1000 || + png_abs(int_y_green - 60000L) > 1000 || + png_abs(int_x_blue - 15000L) > 1000 || + png_abs(int_y_blue - 6000L) > 1000) { png_warning(png_ptr, @@ -925,15 +927,17 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #ifdef PNG_READ_cHRM_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED +#undef png_abs +#define png_abs(x) (((x)>0)?(x):-(x)) if (info_ptr->valid & PNG_INFO_cHRM) - if (abs(info_ptr->int_x_white - 31270L) > 1000 || - abs(info_ptr->int_y_white - 32900L) > 1000 || - abs(info_ptr->int_x_red - 64000L) > 1000 || - abs(info_ptr->int_y_red - 33000L) > 1000 || - abs(info_ptr->int_x_green - 30000L) > 1000 || - abs(info_ptr->int_y_green - 60000L) > 1000 || - abs(info_ptr->int_x_blue - 15000L) > 1000 || - abs(info_ptr->int_y_blue - 6000L) > 1000) + if (png_abs(info_ptr->int_x_white - 31270L) > 1000 || + png_abs(info_ptr->int_y_white - 32900L) > 1000 || + png_abs(info_ptr->int_x_red - 64000L) > 1000 || + png_abs(info_ptr->int_y_red - 33000L) > 1000 || + png_abs(info_ptr->int_x_green - 30000L) > 1000 || + png_abs(info_ptr->int_y_green - 60000L) > 1000 || + png_abs(info_ptr->int_x_blue - 15000L) > 1000 || + png_abs(info_ptr->int_y_blue - 6000L) > 1000) { png_warning(png_ptr, "Ignoring incorrect cHRM value when sRGB is also present"); |