aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-12-01 02:16:53 +0100
committerMattias Andrée <maandree@kth.se>2016-12-01 02:16:53 +0100
commitcfe00fbb57eb757cf9f2130dc112dab8f4b929a3 (patch)
treec1f0a0a277168ac8959599a99cf9ca45119fe953 /src
parentcg-icc: m + parse icc table (diff)
downloadcg-tools-cfe00fbb57eb757cf9f2130dc112dab8f4b929a3.tar.gz
cg-tools-cfe00fbb57eb757cf9f2130dc112dab8f4b929a3.tar.bz2
cg-tools-cfe00fbb57eb757cf9f2130dc112dab8f4b929a3.tar.xz
Fix ICC parser
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
-rw-r--r--src/cg-icc.c8
1 files changed, 4 insertions, 4 deletions
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)