JDK-5039494 : PNGImageReader.read does not throw IAException when dest width/height < 1
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-04-28
  • Updated: 2004-09-07
  • Resolved: 2004-09-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6 mustangFixed
Related Reports
Relates :  
The specification for ImageReader.read states that an IllegalArgumentException will be thrown if the param provided is such that the resulting image would have a width or height less than 1. 
The PNG ImageReader does not throw an IllegalArgumentException in the above scenario, therefore not following the specification. A test case demonstrating this is attached. On running the test, use the scrollbar to view regions to the right, this should cause an Exception, but does not.

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang FIXED IN: mustang INTEGRATED IN: mustang

EVALUATION Name: abR10136 Date: 04/29/2004 The PNG image reader does not take into account the size of the destinaton image and does not detect if the destination region is empty. This behaviour does not conform the spec. The solution is to use ImageReader.computeRegions() in order to calculate the source and destination regions. This ensures that the validity of source and destination region will be verified. ======================================================================

PUBLIC COMMENTS PNGImageReader.read does not throw IllegalArgumentException when dest width/height < 1