From 2774999b757aa7c153e28b093807b44536c41250 Mon Sep 17 00:00:00 2001 From: Jia-Hong Chen Date: Fri, 15 Mar 2013 12:31:57 -0700 Subject: [PATCH] 8007927: Improve cmsAllocProfileSequenceDescription Reviewed-by: bae, mschoene, prr --- jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c index 93a574e6654..53bcdf9643e 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c @@ -734,6 +734,10 @@ cmsSEQ* CMSEXPORT cmsAllocProfileSequenceDescription(cmsContext ContextID, cmsUI Seq -> seq = (cmsPSEQDESC*) _cmsCalloc(ContextID, n, sizeof(cmsPSEQDESC)); Seq -> n = n; + if (Seq -> seq == NULL) { + _cmsFree(ContextID, Seq); + return NULL; + } for (i=0; i < n; i++) { Seq -> seq[i].Manufacturer = NULL;