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

Unified Diff: third_party/lcms2-2.6/src/cmsio0.c

Issue 2482523003: lcms: backport upstream commit c0a98d86 (Closed)
Patch Set: Created 4 years, 1 month 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/lcms2-2.6/src/cmsintrp.c ('k') | third_party/lcms2-2.6/src/cmstypes.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/lcms2-2.6/src/cmsio0.c
diff --git a/third_party/lcms2-2.6/src/cmsio0.c b/third_party/lcms2-2.6/src/cmsio0.c
index 5f9f08a6f8b68515385a67f6bfce242162682827..3ed730a92a8b7a20aa72b1d901c6b78faa1fba98 100644
--- a/third_party/lcms2-2.6/src/cmsio0.c
+++ b/third_party/lcms2-2.6/src/cmsio0.c
@@ -1475,6 +1475,17 @@ void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig)
// If the element is already in memory, return the pointer
if (Icc -> TagPtrs[n]) {
+ if (Icc->TagTypeHandlers[n] == NULL) goto Error;
+
+ // Sanity check
+ BaseType = Icc->TagTypeHandlers[n]->Signature;
+ if (BaseType == 0) goto Error;
+
+ TagDescriptor = _cmsGetTagDescriptor(Icc->ContextID, sig);
+ if (TagDescriptor == NULL) goto Error;
+
+ if (!IsTypeSupported(TagDescriptor, BaseType)) goto Error;
+
if (Icc ->TagSaveAsRaw[n]) goto Error; // We don't support read raw tags as cooked
_cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
« no previous file with comments | « third_party/lcms2-2.6/src/cmsintrp.c ('k') | third_party/lcms2-2.6/src/cmstypes.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698