On Tue, 29 Jul 2025 05:38:00 GMT, Jayathirth D V <[email protected]> wrote:
> We need to throw appropriate exception when we pass invalid image index
> values to ImageReader.getImageTypes().
> We throw IOOBE in all other plugins except JPEG, Added appropriate check to
> throw IOOBE when JpegImageReader has invalid image index.
test/jdk/javax/imageio/plugins/jpeg/JpegNegativeImageIndexTest.java line 53:
> 51: ImageReader ir = readers.next();
> 52: try {
> 53: Iterator<ImageTypeSpecifier> types = ir.getImageTypes(-1);
You could expand the test to call this with different non-zero parameters (-2,
-1, 1, 2) to see if the behavior is correct
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26522#discussion_r2246625248