On Fri, 22 May 2026 03:41:52 GMT, Sergey Bylokhov <[email protected]> wrote:

>> src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
>>  line 115:
>> 
>>> 113:                         DataBuffer.getDataTypeSize(dataType));
>>> 114:         if (sls < 0) {
>>> 115:             throw new RasterFormatException("Pixels do not fit");
>> 
>> `sls` can be negative here not because of overflow, but because w is 
>> negative, which per the new spec should throw the next exception:
>> 
>>      * @throws IllegalArgumentException if either {@code w} or {@code h}
>>      *         is less than or equal to 0
>
> Seems the negative w is not covered by the test, so this one was missed?

- Sadly I think I need to copy a chunk of the super-class validation into here 
as it needs to run first.
- I've added negative w, and also illegal dataType to the test.

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

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

Reply via email to