commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] [bugs #10603] ByteLookupTable and ShortLookupTable / index o


From: Michael Koch
Subject: [commit-cp] [bugs #10603] ByteLookupTable and ShortLookupTable / index out of bounds
Date: Wed, 13 Oct 2004 15:25:38 -0400
User-agent: Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, like Gecko)

This mail is an automated notification from the bugs tracker
 of the project: classpath.

/**************************************************************************/
[bugs #10603] Latest Modifications:

Changes by: 
                Michael Koch <address@hidden>
'Date: 
                Mit 13.10.2004 at 19:17 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
I jst commited a fix for this and the attached testcases. Thanks for reporting 
and suggesting a fix.






/**************************************************************************/
[bugs #10603] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10603>
Project: classpath
Submitted by: David Gilbert
On: Mit 06.10.2004 at 22:15

Category:  None
Severity:  5 - Average
Resolution:  Fixed
Privacy:  Public
Assigned to:  None
Status:  Closed
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.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Mit 13.10.2004 at 19:17       By: Michael Koch <mkoch>
I jst commited a fix for this and the attached testcases. Thanks for reporting 
and suggesting a fix.






File Attachments
-------------------

-------------------------------------------------------
Date: Mit 06.10.2004 at 22:17  Name: lookupPixel.java  Size: 6,75KB   By: 
trebligd
Mauve test for ShortLookupTable / lookupPixel method
http://savannah.gnu.org/bugs/download.php?item_id=10603&amp;item_file_id=1740

-------------------------------------------------------
Date: Mit 06.10.2004 at 22:15  Name: lookupPixel.java  Size: 6,71KB   By: 
trebligd
Mauve test
http://savannah.gnu.org/bugs/download.php?item_id=10603&amp;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/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]