[libpng16] Issue a png_benign_error() instead of png_warning() about bad

palette index.
This commit is contained in:
Glenn Randers-Pehrson 2012-03-10 08:48:04 -06:00
parent 71db131882
commit 945cb1f9be
7 changed files with 9 additions and 5 deletions

View File

@ -299,6 +299,7 @@ Version 1.6.0beta17 [March 10, 2012]
header. header.
Version 1.6.0beta18 [March 10, 2012] Version 1.6.0beta18 [March 10, 2012]
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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4050,6 +4050,7 @@ Version 1.6.0beta17 [March 10, 2012]
header. header.
Version 1.6.0beta18 [March 10, 2012] Version 1.6.0beta18 [March 10, 2012]
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 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -4521,7 +4521,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. function) incorrectly returned a value of type png_uint_32.
Checking for invalid palette index on read or write was added at libpng 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); png_set_check_for_invalid_index(png_ptr, allowed);

View File

@ -5529,7 +5529,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. function) incorrectly returned a value of type png_uint_32.
Checking for invalid palette index on read or write was added at libpng 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); png_set_check_for_invalid_index(png_ptr, allowed);

View File

@ -669,7 +669,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
/* Report invalid palette index; added at libng-1.5.10 */ /* Report invalid palette index; added at libng-1.5.10 */
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
png_ptr->num_palette_max > png_ptr->num_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 #endif
do do

View File

@ -1343,7 +1343,7 @@ png_set_check_for_invalid_index(png_structrp png_ptr, int allowed)
{ {
png_debug(1, "in png_set_check_for_invalid_index"); png_debug(1, "in png_set_check_for_invalid_index");
if (allowed) if (allowed > 0)
png_ptr->num_palette_max = 0; png_ptr->num_palette_max = 0;
else else

View File

@ -310,7 +310,7 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED #ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
if (png_ptr->num_palette_max > png_ptr->num_palette) 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 #endif
/* See if user wants us to write information chunks */ /* See if user wants us to write information chunks */