changeset 51904:5ade5b3a227e

8208996: X11 icon window color handing bug Reviewed-by: serb Contributed-by: takiguc@linux.vnet.ibm.com
author serb
date Wed, 08 Aug 2018 18:31:24 -0700
parents f91e995f6d5c
children cd7d2f9154fd
files src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java	Fri Aug 03 12:52:58 2018 -0700
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java	Wed Aug 08 18:31:24 2018 -0700
@@ -281,8 +281,9 @@
                 ColorData cdata = adata.get_color_data(0);
                 int num_colors = cdata.get_awt_numICMcolors();
                 for (int i = 0; i < buf.length; i++) {
-                    buf[i] = (buf[i] >= num_colors) ?
-                        0 : cdata.get_awt_icmLUT2Colors(buf[i]);
+                    int b = Byte.toUnsignedInt(buf[i]);
+                    buf[i] = (b >= num_colors) ?
+                        0 : cdata.get_awt_icmLUT2Colors(b);
                 }
                 bytes = Native.toData(buf);
             } else if (srcBuf instanceof DataBufferInt) {