[libpng16] Issue a png_benign_error() instead of png_warning() about bad
palette index.
This commit is contained in:
parent
71db131882
commit
945cb1f9be
1
ANNOUNCE
1
ANNOUNCE
@ -299,6 +299,7 @@ Version 1.6.0beta17 [March 10, 2012]
|
||||
header.
|
||||
|
||||
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
|
||||
(subscription required; visit
|
||||
|
1
CHANGES
1
CHANGES
@ -4050,6 +4050,7 @@ Version 1.6.0beta17 [March 10, 2012]
|
||||
header.
|
||||
|
||||
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
|
||||
(subscription required; visit
|
||||
|
@ -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.
|
||||
|
||||
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);
|
||||
|
||||
|
3
libpng.3
3
libpng.3
@ -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.
|
||||
|
||||
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);
|
||||
|
||||
|
@ -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 */
|
||||
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
|
||||
|
2
pngset.c
2
pngset.c
@ -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");
|
||||
|
||||
if (allowed)
|
||||
if (allowed > 0)
|
||||
png_ptr->num_palette_max = 0;
|
||||
|
||||
else
|
||||
|
@ -310,7 +310,7 @@ png_write_end(png_structrp png_ptr, png_inforp 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 */
|
||||
|
Loading…
Reference in New Issue
Block a user