8081756: Mastering Matrix Manipulations
Reviewed-by: serb, bae, mschoene
diff --git a/src/share/native/sun/java2d/cmm/lcms/cmsopt.c b/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
index c3267ec..0383b66 100644
--- a/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
+++ b/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
@@ -260,7 +260,9 @@
cmsStage* Multmat = cmsStageAllocMatrix(Lut->ContextID, 3, 3, (const cmsFloat64Number*) &res, NULL);
// Recover the chain
+ if (Multmat != NULL) {
Multmat->Next = chain;
+ }
*pt1 = Multmat;
}