From 7d3e0841259e5d2b8979d2b66e5be1fc49729685 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 14 Jul 2016 11:55:09 -0700 Subject: [PATCH] 8160098: Clean up color profiles Reviewed-by: ssadetsky, bpb, mschoene --- jdk/src/java.desktop/share/native/liblcms/cmsio0.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jdk/src/java.desktop/share/native/liblcms/cmsio0.c b/jdk/src/java.desktop/share/native/liblcms/cmsio0.c index 9e982aecf69..f86f2e738d8 100644 --- a/jdk/src/java.desktop/share/native/liblcms/cmsio0.c +++ b/jdk/src/java.desktop/share/native/liblcms/cmsio0.c @@ -1543,6 +1543,13 @@ 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; + 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);