From 31f4e528424cebd1220ba045ce4eb874272242c4 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 21 Mar 2011 18:20:24 -0500 Subject: [PATCH] [master] Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail to compile when PNG_NO_POINTER_INDEXING is defined. --- ANNOUNCE | 6 ++++-- CHANGES | 4 +++- pngrutil.c | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 9aab294f1..266fd606f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.4.6beta07 - March 20, 2011 +Libpng 1.4.6beta07 - March 21, 2011 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -53,7 +53,7 @@ version 1.4.6beta06 [March 19, 2011] Updated contrib/pngsuite/README to add the word "modify". Added the private PNG_UNUSED() macro definition in pngconf.h. -version 1.4.6beta07 [March 20, 2011] +version 1.4.6beta07 [March 21, 2011] ifdef out mask arrays in pngread.c when interlacing is not supported. Added attribute definition (warnings) for MSC_VER >= 1300 in pngconf.h Added -D_CRT_SECURE_NO_DEPRECATE to CFLAGS in makefile.vcwin32 @@ -64,6 +64,8 @@ version 1.4.6beta07 [March 20, 2011] Fixed incorrect examples of callback prototypes in the manual, that were introduced in libpng-1.0.0. Removed "strip" from contrib/pngminim/*/makefile. + Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail + to compile when PNG_NO_POINTER_INDEXING is defined. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index fde9bd694..971a289bb 100644 --- a/CHANGES +++ b/CHANGES @@ -2765,7 +2765,7 @@ version 1.4.6beta06 [March 19, 2011] Updated contrib/pngsuite/README to add the word "modify". Added the private PNG_UNUSED() macro definition in pngconf.h. -version 1.4.6beta07 [March 20, 2011] +version 1.4.6beta07 [March 21, 2011] ifdef out mask arrays in pngread.c when interlacing is not supported. Added attribute definition (warnings) for MSC_VER >= 1300 in pngconf.h Added -D_CRT_SECURE_NO_DEPRECATE to CFLAGS in makefile.vcwin32 @@ -2776,6 +2776,8 @@ version 1.4.6beta07 [March 20, 2011] Fixed incorrect examples of callback prototypes in the manual, that were introduced in libpng-1.0.0. Removed "strip" from contrib/pngminim/*/makefile. + Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail + to compile when PNG_NO_POINTER_INDEXING is defined. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngrutil.c b/pngrutil.c index 47395a922..113589c69 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1216,9 +1216,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_bytep entry_start; png_sPLT_t new_palette; -#ifdef PNG_POINTER_INDEXING_SUPPORTED png_sPLT_entryp pp; -#endif int data_length, entry_size, i; png_uint_32 skip = 0; png_size_t slength; @@ -1357,7 +1355,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) pp[i].blue = png_get_uint_16(entry_start); entry_start += 2; pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2; } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; + pp[i].frequency = png_get_uint_16(entry_start); entry_start += 2; } #endif