Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4892630
Votes 0
Synopsis PNG Image Reader does not validate the image index passed to some of the methods
Category java:imageio
Reported Against 1.4
Release Fixed mustang(b62)
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs 6410864
Submit Date 18-JUL-2003
Description
The API documentation for reader.getWidth(imgIndex), reader.getHeight(imgIndex), reader.getAspectRatio(imgIndex) claims that the above methods would throw an IndexOutOfBoundsException when the given image index is out of range. But this is not working for PNG ImageReader. PNG ImageReader returns the same width, height and aspect ratio regardless of what imageIndex is passed and the ImageIndex is not at all getting validated. This works fine for other readers such as GIF, JPEG and BMP. This gives an impression to the user that the image index specified by him exists in the input source even if it is out of range. This must be fixed and the exception must be thrown appropriately.

This is noticed since JDK1.4+ on Win32 as well as Solaris platforms.

I have attached a sample code. Execute the sample code as follows.
java ImageReaderTest <img file>
For Ex: java ImageReaderTest cup.png
If you don't see any exception, the bug is reproduced.
Work Around
N/A
Evaluation
Simple fix; should try to get it in for RC.
Posted Date : 2005-10-25 20:34:57.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang