changeset 12716:18580ed0808b

8180877: More deeply colored ICC spaces Reviewed-by: serb, rhalade, mschoene
author prr
date Thu, 29 Jun 2017 12:40:54 -0700
parents 27bf6cc392f3
children 1be13d4a1dae
files src/share/classes/java/awt/color/ICC_ColorSpace.java src/share/native/sun/java2d/cmm/lcms/LCMS.c
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/color/ICC_ColorSpace.java	Thu Jun 22 01:33:27 2017 -0700
+++ b/src/share/classes/java/awt/color/ICC_ColorSpace.java	Thu Jun 29 12:40:54 2017 -0700
@@ -128,6 +128,18 @@
     }
 
     /**
+     * Validate ICC_ColorSpace read from an object input stream
+     */
+    private void readObject(java.io.ObjectInputStream s)
+        throws ClassNotFoundException, java.io.IOException {
+
+        s.defaultReadObject();
+        if (thisProfile == null) {
+            thisProfile = ICC_Profile.getInstance(ColorSpace.CS_sRGB);
+        }
+    }
+
+    /**
     * Returns the ICC_Profile for this ICC_ColorSpace.
     * @return the ICC_Profile for this ICC_ColorSpace.
     */
--- a/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Thu Jun 22 01:33:27 2017 -0700
+++ b/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Thu Jun 29 12:40:54 2017 -0700
@@ -644,7 +644,12 @@
 {
     jclass clsLcmsProfile;
     jobject cmmProfile;
-    jfieldID fid = (*env)->GetFieldID (env,
+    jfieldID fid;
+
+    if (pf == NULL) {
+        return NULL;
+    }
+    fid = (*env)->GetFieldID (env,
         (*env)->GetObjectClass(env, pf),
         "cmmProfile", "Lsun/java2d/cmm/Profile;");
     if (fid == NULL) {