[libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta).

This commit is contained in:
Glenn Randers-Pehrson
2015-10-30 07:57:49 -05:00
parent 06509be841
commit a901eb3ce6
7 changed files with 34 additions and 28 deletions

View File

@@ -1002,6 +1002,9 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
* confusing.
*
* Fix this by not sharing the palette in this way.
*
* Starting with libpng-1.6.19, png_set_PLTE() also issues a png_error() when
* it attempts to set a palette length that is too large for the bit depth.
*/
png_set_PLTE(png_ptr, info_ptr, palette, num);