On Fri, 24 Apr 2026 01:26:11 GMT, Sergey Bylokhov <[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 171:
> 
>> 169:             throw new IllegalArgumentException("scanlineStride must be 
>> > 0");
>> 170:         }
>> 171:         if (((numberOfBits * (long)w) / 
>> DataBuffer.getDataTypeSize(dataType)) > scanlineStride) {
> 
> Should this check uses the same math used in other constructor 
> [here](https://github.com/openjdk/jdk/blob/0091060d34dd72d05beffea1e9e5e21d5538d798/src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java#L109)
> `1 bit * 9 pixels / 8 size > 1` should cause an exception?

It should indeed 'round up'.
fixed and update to test the above numbers

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

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

Reply via email to