On Thu, 28 May 2026 00:47:31 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8381007
>
> src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
>  line 132:
> 
>> 130:                         DataBuffer.getDataTypeSize(dataType));
>> 131:         if (sls < 0) {
>> 132:             throw new RasterFormatException("Pixels do not fit");
> 
> Current implementations can still throw `IllegalArgumentException: 
> scanlineStride must be > 0`, e.g. for
> `new Args4(TYPE_BYTE, 32, 1, 1<<30, RasterFormatException.class)`
> 
> I think we can fix this by declaring `sls` as `long` and checking that it is 
> not less than `0` and not greater than `Integer.MAX_VALUE`. Only after that 
> we should cast it to `int` in the `this()` call.

Yes, and that would be better. Fixed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30826#discussion_r3319656814

Reply via email to