[libpng16] Fixed conceivable but difficult to repro overflow. Also added

two test programs to generate and test a PNG which should have the problem.
This commit is contained in:
John Bowler
2013-01-10 10:55:34 -06:00
committed by Glenn Randers-Pehrson
parent 37109a9f5b
commit 1c6e22a360
6 changed files with 194 additions and 11 deletions

View File

@@ -223,7 +223,10 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
/* Storage for unknown chunks that the library doesn't recognize. */
png_unknown_chunkp unknown_chunks;
unsigned int unknown_chunks_num;
/* The type of this field must match png_struct::user_chunk_cache_max,
* else overflow can occur.
*/
png_uint_32 unknown_chunks_num;
#endif
#ifdef PNG_sPLT_SUPPORTED