From 005a9448fc3c8e1d46d127e7c570af4f3b1c2664 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 19 Apr 2005 04:36:54 +0000 Subject: [PATCH] 2005-04-19 Guilhem Lavaux * java/awt/image/IndexColorModel.java (getRGB): Check if pixel is negative. From-SVN: r98369 --- libjava/ChangeLog | 5 +++++ libjava/java/awt/image/IndexColorModel.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 78f6bff6102..39bc9b3766c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2005-04-19 Guilhem Lavaux + + * java/awt/image/IndexColorModel.java + (getRGB): Check if pixel is negative. + 2005-04-19 Michael Koch * java/awt/image/RasterOp.java: diff --git a/libjava/java/awt/image/IndexColorModel.java b/libjava/java/awt/image/IndexColorModel.java index e4ccc542903..2a8a7887e24 100644 --- a/libjava/java/awt/image/IndexColorModel.java +++ b/libjava/java/awt/image/IndexColorModel.java @@ -432,7 +432,7 @@ public class IndexColorModel extends ColorModel */ public final int getRGB (int pixel) { - if (pixel < map_size) + if (pixel >= 0 && pixel < map_size) return rgb[pixel]; return 0;