< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XIconWindow.java

Print this page
rev 51420 : xiconwin3

@@ -279,12 +279,13 @@
             if (srcBuf instanceof DataBufferByte) {
                 byte[] buf = ((DataBufferByte)srcBuf).getData();
                 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) {
                 bytes = Native.toData(((DataBufferInt)srcBuf).getData());
             } else if (srcBuf instanceof DataBufferUShort) {
< prev index next >