[libpng16] Initialize entire 256-entry palette in png_set_PLTE().

This commit is contained in:
Glenn Randers-Pehrson 2017-11-04 16:31:45 -05:00
parent 7ca2f0e078
commit fc32eb1662

View File

@ -623,7 +623,7 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
PNG_MAX_PALETTE_LENGTH * (sizeof (png_color)))); PNG_MAX_PALETTE_LENGTH * (sizeof (png_color))));
if (num_palette > 0) if (num_palette > 0)
memcpy(png_ptr->palette, palette, (unsigned int)num_palette * memcpy(png_ptr->palette, palette, (unsigned int)PNG_MAX_PALETTE_LENGTH *
(sizeof (png_color))); (sizeof (png_color)));
info_ptr->palette = png_ptr->palette; info_ptr->palette = png_ptr->palette;
info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;