changeset 17391:19b170622680

8180877: More deeply colored ICC spaces Reviewed-by: serb, rhalade, mschoene
author prr
date Thu, 29 Jun 2017 11:53:19 -0700
parents 47ec9f818908
children 4ca8b09a43d3
files src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java src/java.desktop/share/native/liblcms/LCMS.c
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java	Wed Jun 28 16:52:36 2017 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java	Thu Jun 29 11:53:19 2017 -0700
@@ -128,6 +128,18 @@
     }
 
     /**
+     * Validate an 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/java.desktop/share/native/liblcms/LCMS.c	Wed Jun 28 16:52:36 2017 +0100
+++ b/src/java.desktop/share/native/liblcms/LCMS.c	Thu Jun 29 11:53:19 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) {