Browse Source

- minor fix, use unsigned short

development
Andreas Romeyke 8 months ago
parent
commit
388eb8f632
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      src/validate_icc/check_icc_header.c

+ 5
- 4
src/validate_icc/check_icc_header.c View File

@ -241,10 +241,11 @@ icc_returncode_t parse_icc(unsigned long iccsize, char* iccdata, unsigned long e
assert(errmessage != NULL);
assert(errsize > 0);
if (iccsize < 10) FAIL (icc_error_header_generic, "Invalid ICC profile, size is less 10 bytes");
short a = (iccdata[8]) & 0x000f;
short b = ((iccdata[9] & 0x00f0) >>4);
short c = (iccdata[9] & 0x000f);
char profileversion[6]=" "; snprintf(profileversion, 6, "%1i.%1i.%1i", a, b, c);
unsigned short a = (iccdata[8]) & 0x000f;
unsigned short b = ((iccdata[9] & 0x00f0) >>4);
unsigned short c = (iccdata[9] & 0x000f);
char profileversion[6]=" ";
snprintf(profileversion, 6, "%1i.%1i.%1i", a, b, c);
INFO("ICC: profileversion='%s'\n", profileversion);
if (0==strncmp(profileversion, "5.0.0", 5)) return parse_icc_v500(iccsize, iccdata, errsize, errmessage);
if (0==strncmp(profileversion, "4.3.0", 5)) return parse_icc_v430(iccsize, iccdata, errsize, errmessage);


Loading…
Cancel
Save