summaryrefslogtreecommitdiff
path: root/lodepng.h
diff options
context:
space:
mode:
authorLode <lvandeve@gmail.com>2014-11-18 23:37:42 +0100
committerLode <lvandeve@gmail.com>2014-11-18 23:37:42 +0100
commitba274d5b98d1582bba47a1591c9e02b1ff421352 (patch)
tree63a82d5e567b17bc140d67119ce8fd417651b972 /lodepng.h
parentc7353101cea671073ba1a9f4ca9f4cf7e8dbc944 (diff)
protect against invalid chunk lengths in some tools
Diffstat (limited to 'lodepng.h')
-rw-r--r--lodepng.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lodepng.h b/lodepng.h
index ef2c820..8e2e038 100644
--- a/lodepng.h
+++ b/lodepng.h
@@ -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*/