-
Bug
-
Resolution: Fixed
-
P3
-
8, 9, 10
-
b01
-
generic
-
generic
. BandedSampleModel . createDataBuffer computes the size & allocates DataBuffer as
int size = scanlineStride * height;
dataBuffer = new DataBuffer<Type>(size, numBanks);
. This holds good if the BandedSampleModel contains mulitple banks.
. If the BandedSampleModel contains only one bank to store all the bands, the computed size will not suffice and cause ArrayIndexOutOfBounds exception.
. For Example:
Consider a 3 x 3 BandedSampleModel with 1 Bank and 3 Bands
The DataBuffer would be- RRRRRRRRRGGGGGGGGGBBBBBBBBB
The size required is 27 DataBuffer array elements.
The size as computed in existing logic would be (scanline stride) 3 * 3 (height) = 9 array elements.
int size = scanlineStride * height;
dataBuffer = new DataBuffer<Type>(size, numBanks);
. This holds good if the BandedSampleModel contains mulitple banks.
. If the BandedSampleModel contains only one bank to store all the bands, the computed size will not suffice and cause ArrayIndexOutOfBounds exception.
. For Example:
Consider a 3 x 3 BandedSampleModel with 1 Bank and 3 Bands
The DataBuffer would be- RRRRRRRRRGGGGGGGGGBBBBBBBBB
The size required is 27 DataBuffer array elements.
The size as computed in existing logic would be (scanline stride) 3 * 3 (height) = 9 array elements.