Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: third_party/qcms/src/iccread.c

Issue 850793004: Update from https://crrev.com/311346 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/README.chromium ('k') | tools/valgrind/drmemory/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « third_party/qcms/README.chromium ('k') | tools/valgrind/drmemory/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698