On Tue, 21 Apr 2026 18:40:00 GMT, Phil Race <[email protected]> wrote:
>> The bug was filed to note that the constructor for >> MultiPixelPackedSampleModel could throw an odd exception if numberOfBits is >> zero. >> Per the spec this should throw RasterFormatException. >> >> >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > 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? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30826#discussion_r3134927303
