RFR: 8262297: ImageIO.write() method will throw IndexOutOfBoundsException [v3]

Masanori Yano myano at openjdk.java.net
Fri Nov 19 09:04:24 UTC 2021


On Tue, 16 Nov 2021 00:40:35 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java line 1459:
>> 
>>> 1457:         int biType = imgType.getBufferedImageType();
>>> 1458:         int bpp = imgType.getColorModel().getPixelSize();
>>> 1459:         if (bpp != 0 && bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32) {
>> 
>> This change looks good to me.
>
> Probably the exception message caused by this should be updated as well? Currently, it takes care of compression only.

I also think the message should be change. I added bpp information at the end of the exception message.

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

PR: https://git.openjdk.java.net/jdk/pull/6151



More information about the client-libs-dev mailing list