[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

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