8007927: Improve cmsAllocProfileSequenceDescription
authorjgodinez
Fri, 15 Mar 2013 12:31:57 -0700
changeset 18194 3219612ef61c
parent 18193 3812d4a4207a
child 18195 7ea73f748935
8007927: Improve cmsAllocProfileSequenceDescription Reviewed-by: bae, mschoene, prr Contributed-by: jia-hong.chen@oracle.com
jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c	Wed Mar 13 17:24:34 2013 -0700
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c	Fri Mar 15 12:31:57 2013 -0700
@@ -734,6 +734,10 @@
     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;