[Patch] java.awt.image.IndexColorModel

Michael Koch konqueror@gmx.de
Tue Apr 19 04:38:00 GMT 2005


Hi list,


I just merged the attached patch from GNU classpath.


Michael


2005-04-19  Guilhem Lavaux  <guilhem@kaffe.org>

	* java/awt/image/IndexColorModel.java
	(getRGB): Check if pixel is negative.

-------------- next part --------------
Index: java/awt/image/IndexColorModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/IndexColorModel.java,v
retrieving revision 1.8
diff -u -r1.8 IndexColorModel.java
--- java/awt/image/IndexColorModel.java	16 Feb 2005 20:02:06 -0000	1.8
+++ java/awt/image/IndexColorModel.java	19 Apr 2005 04:36:16 -0000
@@ -432,7 +432,7 @@
    */
   public final int getRGB (int pixel)
   {
-    if (pixel < map_size)
+    if (pixel >= 0 && pixel < map_size)
 	    return rgb[pixel];
     
     return 0;


More information about the Java-patches mailing list