diff options
author | Lode <lvandeve@gmail.com> | 2014-11-18 23:37:42 +0100 |
---|---|---|
committer | Lode <lvandeve@gmail.com> | 2014-11-18 23:37:42 +0100 |
commit | ba274d5b98d1582bba47a1591c9e02b1ff421352 (patch) | |
tree | 63a82d5e567b17bc140d67119ce8fd417651b972 /lodepng.h | |
parent | c7353101cea671073ba1a9f4ca9f4cf7e8dbc944 (diff) |
protect against invalid chunk lengths in some tools
Diffstat (limited to 'lodepng.h')
-rw-r--r-- | lodepng.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -677,7 +677,11 @@ Third byte: must be uppercase Fourth byte: uppercase = unsafe to copy, lowercase = safe to copy */ -/*get the length of the data of the chunk. Total chunk length has 12 bytes more.*/ +/* +Gets the length of the data of the chunk. Total chunk length has 12 bytes more. +There must be at least 4 bytes to read from. If the result value is too large, +it may be corrupt data. +*/ unsigned lodepng_chunk_length(const unsigned char* chunk); /*puts the 4-byte type in null terminated string*/ |