8208996: X11 icon window color handing bug
Reviewed-by: serb
Contributed-by: takiguc@linux.vnet.ibm.com
--- 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) {