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

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

Issue 1138473002: qcms: Limit vcgt table to a maximum of 1024 entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/google.patch ('k') | no next file » | 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 18b286ddbd973dafedfd7698925c52e95a7edb6f..0deab10a3d06886e8253f520534423a902affd48 100644
--- a/third_party/qcms/src/iccread.c
+++ b/third_party/qcms/src/iccread.c
@@ -386,6 +386,10 @@ qcms_bool read_tag_vcgtType(qcms_profile *profile, struct mem_source *src, struc
// Only support table data, not equation.
if (vcgt_type != 0)
return true;
+ // Limit the table to a sensible size; 10-bit gamma is a reasonable
+ // maximum for hardware correction.
+ if (elements > 1024)
+ return true;
// Empty table is invalid.
if (!elements)
« no previous file with comments | « third_party/qcms/google.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698