[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bugs #10603] ByteLookupTable and ShortLookupTable / index o
From: |
David Gilbert |
Subject: |
[commit-cp] [bugs #10603] ByteLookupTable and ShortLookupTable / index out of bounds |
Date: |
Wed, 06 Oct 2004 18:22:37 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 Epiphany/1.0.7 |
This mail is an automated notification from the bugs tracker
of the project: classpath.
/**************************************************************************/
[bugs #10603] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10603>
Project: classpath
Submitted by: David Gilbert
On: Wed 10/06/2004 at 22:15
Category: None
Severity: 5 - Average
Resolution: None
Privacy: Public
Assigned to: None
Status: Open
Platform Version: None
Summary: ByteLookupTable and ShortLookupTable / index out of bounds
Original Submission: The following code throws an
ArrayIndexOutOfBoundsException:
public static void main(String[] args) {
byte[] data = {105, 104, 103, 102, 101, 100};
ByteLookupTable t = new ByteLookupTable(100, data);
// check 3-band source with 1-band lookup table
int[] src = new int[] {100, 101, 102};
int[] dst = t.lookupPixel(src, null);
}
This bug is triggered in the lookupPixel(src, dst) methods of both the
java.awt.image.ByteLookupTable and java.awt.image.ShortLookupTable classes when
(a) dst is null, and (b) the number of bands in the lookup table is less than
the number of elements in src.
Looking at the source code, it appears that 'dst' should be initialised with
'src.length' elements, rather than 'numComponents' elements.
Mauve tests are attached.
File Attachments
-------------------
-------------------------------------------------------
Date: Wed 10/06/2004 at 22:15 Name: lookupPixel.java Size: 6.71KB By:
trebligd
Mauve test
http://savannah.gnu.org/bugs/download.php?item_id=10603&item_file_id=1739
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10603>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [commit-cp] [bugs #10603] ByteLookupTable and ShortLookupTable / index out of bounds,
David Gilbert <=