-
Enhancement
-
Resolution: Fixed
-
P4
-
1.2.0, 1.4.0
-
beta
-
generic
-
generic, solaris_7
All of the classes in java.awt.image and sun.awt.image that implement
'SampleModel' and 'Raster' should perform bounds checking in all of their
pixel accessor methods:
{get,set}DataElements
{get,set}Pixel
{get,set}Pixels
{get,set}Sample
{get,set}Samples
{get,put}{Byte,Short}Data
Currently, they document that an ArrayOutOfBoundsException 'may' be thrown.
However, in practice the (x, y) coordinates are used to construct an
array index, which may lie within the relevant array even though the
coordinate does not lie within the image bounds.
The band index 'b' is usually used to index a band offsets array in such
a way that a proper exception is guaranteed to be thrown, so explicit bounds
checking is not required.
'SampleModel' and 'Raster' should perform bounds checking in all of their
pixel accessor methods:
{get,set}DataElements
{get,set}Pixel
{get,set}Pixels
{get,set}Sample
{get,set}Samples
{get,put}{Byte,Short}Data
Currently, they document that an ArrayOutOfBoundsException 'may' be thrown.
However, in practice the (x, y) coordinates are used to construct an
array index, which may lie within the relevant array even though the
coordinate does not lie within the image bounds.
The band index 'b' is usually used to index a band offsets array in such
a way that a proper exception is guaranteed to be thrown, so explicit bounds
checking is not required.
- duplicates
-
JDK-4202347 getPixel mtds in all implementing classes of SampleModel accepts -ve x
- Closed