On Mon, 18 May 2026 22:57:34 GMT, Sergey Bylokhov <[email protected]> wrote:
>> thanks, I remember that crossing my mind but then forgot about it.
>> Fixed now, I think.
>
> The second constructor can get overflow in intermediate calculation as well:
> new MultiPixelPackedSampleModel(TYPE_BYTE, 1<<29, 1, 4, 1<<28, 0);
> new MultiPixelPackedSampleModel(TYPE_BYTE, 1<<29, 1, 4);
> both should end in the same MultiPixelPackedSampleModel, but 4arg constructor
> thrown an exception.
>
> Also the new javadoc should probably include the casts used in the code?
>
> * @throws RasterFormatException if
> * {@code ((numberOfBits * w) +
> DataBuffer.getDataTypeSize(dataType) - 1)
We probably should check the math in the
MultiPixelPackedSampleModel.createDataBuffer() as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30826#discussion_r3262857796