[libpng15] Don't do the palette-index checking when num_palette is 0.

This commit is contained in:
Glenn Randers-Pehrson 2012-06-07 09:56:30 -05:00
parent 6a169bbe76
commit ff355004dd
3 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.11rc05 - June 6, 2012 Libpng 1.5.11rc05 - June 7, 2012
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -57,7 +57,8 @@ Version 1.5.11rc03 [June 4, 2012]
Version 1.5.11rc04 [June 6, 2012] Version 1.5.11rc04 [June 6, 2012]
Improved efficiency of new do_check_palette_indexes() function. Improved efficiency of new do_check_palette_indexes() function.
Version 1.5.11rc05 [June 6, 2012] Version 1.5.11rc05 [June 7, 2012]
Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
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

@ -3885,7 +3885,8 @@ Version 1.5.11rc03 [June 4, 2012]
Version 1.5.11rc04 [June 6, 2012] Version 1.5.11rc04 [June 6, 2012]
Improved performance of new do_check_palette_indexes() function. Improved performance of new do_check_palette_indexes() function.
Version 1.5.11rc05 [June 6, 2012] Version 1.5.11rc05 [June 7, 2012]
Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
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

@ -626,7 +626,7 @@ void /* PRIVATE */
png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info) png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
{ {
if (png_ptr->num_palette < (1 << row_info->bit_depth) && if (png_ptr->num_palette < (1 << row_info->bit_depth) &&
png_ptr->num_palette_max >= 0) png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */
{ {
/* Calculations moved outside switch in an attempt to stop different /* Calculations moved outside switch in an attempt to stop different
* compiler warnings. 'padding' is in *bits* within the last byte, it is * compiler warnings. 'padding' is in *bits* within the last byte, it is