changeset 7403:9f99c9ab588b

8007927: Improve cmsAllocProfileSequenceDescription Reviewed-by: bae, mschoene, prr Contributed-by: jia-hong.chen@oracle.com
author jgodinez
date Fri, 15 Mar 2013 12:31:57 -0700
parents 30f15138e298
children bf7120252a95
files src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c	Wed Mar 13 17:24:34 2013 -0700
+++ b/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;