From a92e5a86f8f01b43b9dde5c996caa331b4e8a3d5 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 10 Feb 2013 18:01:47 -0600 Subject: [PATCH] [libpng15] Fix inconsistencies in use of PNG_GET_PALETTE_MAX --- png.h | 10 ++++------ pngget.c | 4 ++-- scripts/pnglibconf.dfa | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/png.h b/png.h index 6e19ea887..51dca1924 100644 --- a/png.h +++ b/png.h @@ -2651,16 +2651,14 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); : (png_int_32)png_get_uint_32(buf))) #endif -#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ - defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr, int allowed)); -#if defined(PNG_READ_GET_PALETTE_MAX_SUPPORTED) || \ - defined(PNG_READ_GET_PALETTE_MAX_SUPPORTED) +# ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(235, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); -#endif -#endif +# endif +#endif /* CHECK_FOR_INVALID_INDEX */ /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs diff --git a/pngget.c b/pngget.c index 1a23e80d8..025db2ece 100644 --- a/pngget.c +++ b/pngget.c @@ -1128,7 +1128,7 @@ png_get_io_chunk_name (png_structp png_ptr) #endif /* ?PNG_IO_STATE_SUPPORTED */ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED -#ifdef PNG_GET_PALETTE_MAX_SUPPORTED +# ifdef PNG_GET_PALETTE_MAX_SUPPORTED int PNGAPI png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr) { @@ -1137,7 +1137,7 @@ png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr) return (-1); } -#endif +# endif #endif #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa index f97eb740c..3c30223da 100644 --- a/scripts/pnglibconf.dfa +++ b/scripts/pnglibconf.dfa @@ -589,8 +589,7 @@ option READ_CHECK_FOR_INVALID_INDEX requires READ CHECK_FOR_INVALID_INDEX option WRITE_CHECK_FOR_INVALID_INDEX requires WRITE CHECK_FOR_INVALID_INDEX # added at libpng-1.5.15 -option GET_PALETTE_MAX enables READ_GET_PALETTE_MAX -option GET_PALETTE_MAX enables WRITE_GET_PALETTE_MAX -option READ_GET_PALETTE_MAX requires CHECK_FOR_INVALID_INDEX -option WRITE_GET_PALETTE_MAX requires CHECK_FOR_INVALID_INDEX +option GET_PALETTE_MAX enables READ_GET_PALETTE_MAX WRITE_GET_PALETTE_MAX +option READ_GET_PALETTE_MAX requires READ_CHECK_FOR_INVALID_INDEX disabled +option WRITE_GET_PALETTE_MAX requires WRITE_CHECK_FOR_INVALID_INDEX disabled