diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2004-08-03 16:49:33 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2004-08-03 16:49:33 (GMT) |
commit | f4bab88acea24b261d85d25359c73cbb49869c5f (patch) | |
tree | 947221d2f202d586f7f386c57472cc941980963f /libpng/pngrutil.c | |
parent | d7bf5675c4490ac0291cf1795b7499f2047d5c58 (diff) | |
download | Doxygen-f4bab88acea24b261d85d25359c73cbb49869c5f.zip Doxygen-f4bab88acea24b261d85d25359c73cbb49869c5f.tar.gz Doxygen-f4bab88acea24b261d85d25359c73cbb49869c5f.tar.bz2 |
Release-1.3.8-20040803
Diffstat (limited to 'libpng/pngrutil.c')
-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"); |