[libpng15] Improved the efficiency of the new png_check_palette_indexes()

function.
This commit is contained in:
Glenn Randers-Pehrson 2012-06-06 13:04:47 -05:00
parent d5d0bd91d2
commit c924d3dd25
5 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.11rc04 - June 4, 2012
Libpng 1.5.11rc04 - June 6, 2012
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.
@ -54,7 +54,8 @@ Version 1.5.11rc03 [June 4, 2012]
performs an optimization which is safe; however it then warns about it.
Changing the type of 'palette_number' in pngvalid.c removes the warning.
Version 1.5.11rc04 [June 4, 2012]
Version 1.5.11rc04 [June 6, 2012]
Improved efficiency of new do_check_palette_indexes() function.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit

View File

@ -3882,7 +3882,8 @@ Version 1.5.11rc03 [June 4, 2012]
performs an optimization which is safe; however it then warns about it.
Changing the type of 'palette_number' in pngvalid.c removes the warning.
Version 1.5.11rc04 [June 4, 2012]
Version 1.5.11rc04 [June 6, 2012]
Improved performance of new do_check_palette_indexes() function.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -2301,7 +2301,8 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Added at libpng-1.5.10 */
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
png_ptr->num_palette_max >= 0)
png_do_check_palette_indexes(png_ptr, row_info);
#endif

View File

@ -708,7 +708,7 @@ png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
{
for (; rp > png_ptr->row_buf; rp--)
{
if (*rp >= png_ptr->num_palette_max)
if (*rp > png_ptr->num_palette_max)
png_ptr->num_palette_max = (int) *rp;
}

View File

@ -806,7 +806,8 @@ png_write_row(png_structp png_ptr, png_const_bytep row)
/* Added at libpng-1.5.10 */
#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Check for out-of-range palette index */
if(row_info.color_type == PNG_COLOR_TYPE_PALETTE)
if (row_info.color_type == PNG_COLOR_TYPE_PALETTE &&
png_ptr->num_palette_max >= 0)
png_do_check_palette_indexes(png_ptr, &row_info);
#endif