From cfe00fbb57eb757cf9f2130dc112dab8f4b929a3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 1 Dec 2016 02:16:53 +0100 Subject: Fix ICC parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cg-icc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cg-icc.c b/src/cg-icc.c index 0ed8d3e..a3e48cd 100644 --- a/src/cg-icc.c +++ b/src/cg-icc.c @@ -543,7 +543,7 @@ static int parse_icc(const char* restrict content, size_t n, libcoopgamma_ramps_ if (n - ptr < 4) continue; tag_name = icc_uint32(content + ptr), ptr += 4; - if (tag_name == VCGT_TAG) + if (tag_name != VCGT_TAG) continue; /* Skip four bytes */ @@ -564,9 +564,9 @@ static int parse_icc(const char* restrict content, size_t n, libcoopgamma_ramps_ /* Get metadata */ if (n - ptr < 3 * 4) continue; - n_channels = icc_uint32(content + ptr), ptr += 4; - n_entries = icc_uint32(content + ptr), ptr += 4; - entry_size = icc_uint32(content + ptr), ptr += 4; + n_channels = icc_uint16(content + ptr), ptr += 2; + n_entries = icc_uint16(content + ptr), ptr += 2; + entry_size = icc_uint16(content + ptr), ptr += 2; if (tag_size == 1584) n_channels = 3, n_entries = 256, entry_size = 2; if (n_channels != 3) -- cgit v1.2.3-70-g09d2