diff options
author | SlowRiot <rain.backnet@gmail.com> | 2014-11-27 04:13:51 +0000 |
---|---|---|
committer | SlowRiot <rain.backnet@gmail.com> | 2014-11-27 04:13:51 +0000 |
commit | e205cb35be0d53730ee8c8c8082255d3f50c5d12 (patch) | |
tree | 1d924292d24581ebad4bff1c7afd5437fd2f60b0 /lodepng.h | |
parent | e14137419c1d444ed61a6789bd3dd6942cdc7405 (diff) | |
parent | 71b8c3ad7338b41b43676ad4212f6d820d4ce193 (diff) |
Merge branch 'master' of https://github.com/lvandeve/lodepng
# By Lode (10) and others
# Via Lode
* 'master' of https://github.com/lvandeve/lodepng:
fix for C
fix examples
better bitpointer checks
small tweaks
Update lodepng.h
Update lodepng.cpp
avoid too big pixel sizes
predict idat size correctly for interlaced images
unit test was a bit slow like that
fix bug with encoding transparent single-pixel image
protect against invalid chunk lengths in some tools
fix pngdetail.cpp
collapsing duplicate branch
do not check unsigned windowsize for < 0
Conflicts:
lodepng.cpp
Diffstat (limited to 'lodepng.h')
-rw-r--r-- | lodepng.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,5 @@ /* -LodePNG version 20140823 +LodePNG version 20141120 Copyright (c) 2005-2014 Lode Vandevenne @@ -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, @@ -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*/ |