From ba274d5b98d1582bba47a1591c9e02b1ff421352 Mon Sep 17 00:00:00 2001 From: Lode Date: Tue, 18 Nov 2014 23:37:42 +0100 Subject: protect against invalid chunk lengths in some tools --- lodepng.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lodepng.h') 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*/ -- cgit v1.2.3 From d6e061315e6df91a4d8025daefea769896190eef Mon Sep 17 00:00:00 2001 From: Lode Date: Wed, 19 Nov 2014 22:13:54 +0100 Subject: fix bug with encoding transparent single-pixel image --- lodepng.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lodepng.h') diff --git a/lodepng.h b/lodepng.h index 8e2e038..a934118 100644 --- a/lodepng.h +++ b/lodepng.h @@ -1,5 +1,5 @@ /* -LodePNG version 20140823 +LodePNG version 20141119 Copyright (c) 2005-2014 Lode Vandevenne -- cgit v1.2.3 From 0941f444db75ecf6394520399ac82e76d9bb5c54 Mon Sep 17 00:00:00 2001 From: lvandeve Date: Thu, 20 Nov 2014 15:15:29 +0100 Subject: Update lodepng.h Rename function because all exported symbol names should start with lodepng to avoid clashes --- lodepng.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lodepng.h') diff --git a/lodepng.h b/lodepng.h index a934118..035a292 100644 --- a/lodepng.h +++ b/lodepng.h @@ -568,9 +568,9 @@ typedef struct LodePNGColorProfile void lodepng_color_profile_init(LodePNGColorProfile* profile); /*Get a LodePNGColorProfile of the image.*/ -unsigned get_color_profile(LodePNGColorProfile* profile, - const unsigned char* image, unsigned w, unsigned h, - const LodePNGColorMode* mode_in); +unsigned lodepng_get_color_profile(LodePNGColorProfile* profile, + const unsigned char* image, unsigned w, unsigned h, + const LodePNGColorMode* mode_in); /*The function LodePNG uses internally to decide the PNG color with auto_convert. Chooses an optimal color model, e.g. grey if only grey pixels, palette if < 256 colors, ...*/ unsigned lodepng_auto_choose_color(LodePNGColorMode* mode_out, -- cgit v1.2.3 From 71b8c3ad7338b41b43676ad4212f6d820d4ce193 Mon Sep 17 00:00:00 2001 From: Lode Date: Fri, 21 Nov 2014 02:02:36 +0100 Subject: fix for C --- lodepng.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lodepng.h') diff --git a/lodepng.h b/lodepng.h index 035a292..b131ef3 100644 --- a/lodepng.h +++ b/lodepng.h @@ -1,5 +1,5 @@ /* -LodePNG version 20141119 +LodePNG version 20141120 Copyright (c) 2005-2014 Lode Vandevenne -- cgit v1.2.3