[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

@@ -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