RFR: 8364135: JPEGImageReader.getImageTypes() should throw exception for negative image index [v2]
Jayathirth D V
jdv at openjdk.org
Thu Aug 21 05:06:57 UTC 2025
On Fri, 1 Aug 2025 00:31:45 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> Jayathirth D V has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Update test to handle all regression cases
>> - Add checks at other places also
>> - Merge remote-tracking branch 'upstream/master' into jpeg_getImageTypes
>> - Check only for negative index
>> - 8364135: JPEGImageReader.getImageTypes() should throw exception for non-zero 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
Latest findings show that only in case of "-1" index we have issues.
So testing for only "-1" index is fine.
Also the test is updated to call getWidth(), getHeight(), getRawImageType() & getImageTypes().
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26522#discussion_r2289862785
More information about the client-libs-dev
mailing list