| Index: third_party/qcms/src/iccread.c
|
| diff --git a/third_party/qcms/src/iccread.c b/third_party/qcms/src/iccread.c
|
| index aca19d3ffec5b61847e3bae02bf39b7200aca0c2..7790c07f490e7819d2c6a179d06ca06a21730103 100644
|
| --- a/third_party/qcms/src/iccread.c
|
| +++ b/third_party/qcms/src/iccread.c
|
| @@ -366,6 +366,7 @@ static bool read_tag_descType(qcms_profile *profile, struct mem_source *src, str
|
| uint32_t type = read_u32(src, offset);
|
| uint32_t length = read_u32(src, offset+8);
|
| uint32_t i, description;
|
| + bool mluc = false;
|
| if (length && type == MLUC_TYPE) {
|
| length = read_u32(src, offset+20);
|
| if (!length || (length & 1) || (read_u32(src, offset+12) != 12))
|
| @@ -373,6 +374,7 @@ static bool read_tag_descType(qcms_profile *profile, struct mem_source *src, str
|
| description = offset + read_u32(src, offset+24);
|
| if (!src->valid)
|
| goto invalid_desc_tag;
|
| + mluc = true;
|
| } else if (length && type == DESC_TYPE) {
|
| description = offset + 12;
|
| } else {
|
| @@ -380,8 +382,14 @@ static bool read_tag_descType(qcms_profile *profile, struct mem_source *src, str
|
| }
|
| if (length >= limit)
|
| length = limit - 1;
|
| - for (i = 0; i < length; ++i)
|
| - profile->description[i] = read_u8(src, description+i);
|
| + for (i = 0; i < length; ++i) {
|
| + uint8_t value = read_u8(src, description+i);
|
| + if (!src->valid)
|
| + goto invalid_desc_tag;
|
| + if (mluc && !value)
|
| + value = '.';
|
| + profile->description[i] = value;
|
| + }
|
| profile->description[length] = 0;
|
| } else {
|
| goto invalid_desc_tag;
|
|
|