RFR: 8364135: JPEGImageReader.getImageTypes() should throw exception for negative image index [v4]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Aug 26 05:52:38 UTC 2025
On Tue, 26 Aug 2025 05:46:13 GMT, Jayathirth D V <jdv at openjdk.org> 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.
>
> Jayathirth D V has updated the pull request incrementally with two additional commits since the last revision:
>
> - Make test more robust
> - Use thread lock
src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java line 848:
> 846: public int getWidth(int imageIndex) throws IOException {
> 847: setThreadLock();
> 848: verifyImageIndex(imageIndex);
Dont we need to put in inside try-finally block for it to call `clearThreadLock` as it is throwing an exception?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26522#discussion_r2299852344
More information about the client-libs-dev
mailing list