8014497: [parfait] Potential null pointer dereference in jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
authorjchen
Wed, 03 Jul 2013 10:22:13 -0700
changeset 18750 e06dee31a864
parent 18749 482096e5f614
child 18751 60debf1e00b2
8014497: [parfait] Potential null pointer dereference in jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c Reviewed-by: bae, prr
jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Wed Jul 03 19:00:10 2013 +0400
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c	Wed Jul 03 10:22:13 2013 -0700
@@ -548,6 +548,10 @@
         for (i=0; i < nOuts; i++) {
 
             cmsToneCurve* InversePostLin = cmsReverseToneCurve(Curves[i]);
+            if (InversePostLin == NULL) {
+                WhiteOut[i] = 0;
+                continue;
+            }
             WhiteOut[i] = cmsEvalToneCurve16(InversePostLin, WhitePointOut[i]);
             cmsFreeToneCurve(InversePostLin);
         }