[libpng16] Initialize entire 256-entry palette in png_set_PLTE().
This commit is contained in:
parent
7ca2f0e078
commit
fc32eb1662
2
pngset.c
2
pngset.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user