8007927: Improve cmsAllocProfileSequenceDescription
Reviewed-by: bae, mschoene, prr
Contributed-by: jia-hong.chen@oracle.com
--- 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;