diff --git a/ANNOUNCE b/ANNOUNCE index bc38faf13..e78709093 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -48,7 +48,8 @@ Version 1.5.10beta02 [February 27, 2012] Version 1.5.10beta03 [March 6, 2012] Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c - Added palette-index checking. + Added palette-index checking. Issue a png_warning() if an invalid index is + found. Version 1.5.10beta04 [March 10, 2012] Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. @@ -57,6 +58,7 @@ Version 1.5.10beta04 [March 10, 2012] Version 1.5.10beta05 [March 10, 2012] Reject all iCCP chunks after the first, even if the first one is invalid. + Issue a png_benign_error() instead of png_warning() about bad palette index. Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 78857d80b..f59777bd4 100644 --- a/CHANGES +++ b/CHANGES @@ -3833,7 +3833,8 @@ Version 1.5.10beta02 [February 27, 2012] Version 1.5.10beta03 [March 6, 2012] Removed unused "current_text" members of png_struct and the png_free() of png_ptr->current_text from pngread.c - Added palette-index checking. + Added palette-index checking. Issue a png_warning() if an invalid index is + found. Version 1.5.10beta04 [March 10, 2012] Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition. @@ -3842,6 +3843,7 @@ Version 1.5.10beta04 [March 10, 2012] Version 1.5.10beta05 [March 10, 2012] Reject all iCCP chunks after the first, even if the first one is invalid. + Issue a png_benign_error() instead of png_warning() about bad palette index. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/libpng-manual.txt b/libpng-manual.txt index 7fcfd1697..865f96fa8 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -4143,7 +4143,8 @@ From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the function) incorrectly returned a value of type png_uint_32. Checking for invalid palette index on read or write was added at libpng -1.5.10. This is enabled by default but can be disabled in each png_ptr with +1.5.10. When an invalid index is found, libpng issues a benign error. +This is enabled by default but can be disabled in each png_ptr with png_set_check_for_invalid_index(png_ptr, allowed); diff --git a/libpng.3 b/libpng.3 index b6aaa919f..ac3f15f23 100644 --- a/libpng.3 +++ b/libpng.3 @@ -5125,7 +5125,8 @@ From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the function) incorrectly returned a value of type png_uint_32. Checking for invalid palette index on read or write was added at libpng -1.5.10. This is enabled by default but can be disabled in each png_ptr with +1.5.10. When an invalid index is found, libpng issues a benign error. +This is enabled by default but can be disabled in each png_ptr with png_set_check_for_invalid_index(png_ptr, allowed); diff --git a/pngread.c b/pngread.c index 6f949f630..3e487dea0 100644 --- a/pngread.c +++ b/pngread.c @@ -805,7 +805,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) /* Report invalid palette index; added at libng-1.5.10 */ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_palette_max > png_ptr->num_palette) - png_warning(png_ptr, "Read palette index exceeding num_palette"); + png_benign_error(png_ptr, "Read palette index exceeding num_palette"); #endif do diff --git a/pngwrite.c b/pngwrite.c index 74aa7368e..87550d6b3 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -307,7 +307,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED if (png_ptr->num_palette_max > png_ptr->num_palette) - png_warning(png_ptr, "Wrote palette index exceeding num_palette"); + png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); #endif /* See if user wants us to write information chunks */