--- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java Mon Jun 05 12:36:15 2017 -0300
+++ 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 Mon Jun 05 12:36:15 2017 -0300
+++ 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) {