8007925: Improve cmsStageAllocLabV2ToV4curves
authorjgodinez
Wed, 27 Mar 2013 15:58:39 -0700
changeset 18210 662eb8b3dfb5
parent 18209 6d003de63e55
child 18211 74aeb4741e3d
8007925: Improve cmsStageAllocLabV2ToV4curves 8007926: Improve cmsPipelineDup Reviewed-by: bae, mschoene, prr Contributed-by: jia-hong.chen@oracle.com
jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Wed Mar 27 11:38:46 2013 -0700
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c	Wed Mar 27 15:58:39 2013 -0700
@@ -1021,6 +1021,7 @@
     mpe = cmsStageAllocToneCurves(ContextID, 3, LabTable);
     cmsFreeToneCurveTriple(LabTable);
 
+    if (mpe == NULL) return mpe;
     mpe ->Implements = cmsSigLabV2toV4;
     return mpe;
 }
@@ -1424,6 +1425,8 @@
     if (lut == NULL) return NULL;
 
     NewLUT = cmsPipelineAlloc(lut ->ContextID, lut ->InputChannels, lut ->OutputChannels);
+    if (NewLUT == NULL) return NULL;
+
     for (mpe = lut ->Elements;
          mpe != NULL;
          mpe = mpe ->Next) {