[libpng16] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr

not info_ptr.
This commit is contained in:
Glenn Randers-Pehrson
2015-11-22 20:53:02 -06:00
parent a1a2ae2a25
commit 0a9afc12de
3 changed files with 7 additions and 3 deletions

View File

@@ -520,8 +520,8 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
if (png_ptr == NULL || info_ptr == NULL)
return;
max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
(1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
(1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
if (num_palette < 0 || num_palette > (int) max_palette_length)
{