[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

@@ -626,7 +626,7 @@ void /* PRIVATE */
png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info)
{
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
* compiler warnings. 'padding' is in *bits* within the last byte, it is