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: 4857245
Votes 8
Synopsis SubsampleAverage throws ArrayIndexOutOfBoundsException
Category jai:implementation
Reported Against 1.1.2 , 1.1.2-dev
Release Fixed 1.1.3-alpha
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6331420
Submit Date 01-MAY-2003
Description
SubsampleAverage throws ArrayIndexOutOfBoundsException when run the attached code with a paremetr 0.4.  It is okay for 0.5.
Work Around
N/A
Evaluation
  xxxxx@xxxxx   2004-09-02

SubsampleAverageOpImage.backwardMapRect() creates a Rectangle which includes area outside the bounds of the source image and GeometricOpImage.mapDestRect() does not clip this Rectangle so that as there is no BorderExtender the getData() call applied to the source throws an Exception.

  xxxxx@xxxxx   2004-09-03

The implementation of SubsampleAverageOpImage.backwardMapRect() is incorrect. It ends up including area to the right and below that which is really necessary in the source. This is due to calculating the width and height of the backward mapped rectangle directly instead of calculating the difference between the backward mapped positions of the upper left and lower right corners. As the JAI portion of the mediaLib implementation is a subclass this problem affects both native and Java implementations.

A secondary problem is that GeometricOpImage.computeTile() does not clip the result of mapDestRect() to the source bounds when there is no BorderExtender (as is always the case for SubsampleAverage) and the rectangle returned by mapDestRect() includes area outside the source bounds.
Comments
  
  Include a link with my name & email   

Submitted On 01-JUN-2004
acsoftware1978@yahoo.com
Same error with different xFactor/yFactor



PLEASE NOTE: JDK6 is formerly known as Project Mustang