jdk/src/share/classes/java/awt/color/ICC_Profile.java
changeset 14643 be37da9c57d7
parent 12813 c10ab96dcf41
child 16734 da1901d79073
--- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Wed Nov 28 12:38:43 2012 +0400
+++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Wed Nov 28 14:12:32 2012 +0400
@@ -1435,7 +1435,15 @@
 
         int renderingIntent = intFromBigEndian(theHeader, icHdrRenderingIntent);
                                                  /* set the rendering intent */
-        return renderingIntent;
+
+        /* According to ICC spec, only the least-significant 16 bits shall be
+         * used to encode the rendering intent. The most significant 16 bits
+         * shall be set to zero. Thus, we are ignoring two most significant
+         * bytes here.
+         *
+         *  See http://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15.
+         */
+        return (0xffff & renderingIntent);
     }