[OpenJDK 2D-Dev] [11] RFR JDK-8191073: JpegImageReader throws IndexOutOfBoundsException when trying to read image data from tables-only image

Jayathirth D V jayathirth.d.v at oracle.com
Mon Jan 8 07:23:50 UTC 2018


Hi Brian,

 

Thanks for your valuable inputs.

 

As I was debugging the issue I started capturing this "tablesOnlyStream" boolean variable in checkTablesOnly() method and I started using it at other places also. As rightly pointed by you we don't need this "tablesOnlyStream" as it not used anywhere else and we can use imagePositions to know whether it is tables-only stream.

 

I have removed the usage of tablesOnlyStream variable in code and updated the comment section.

Please find updated webrev for review:

http://cr.openjdk.java.net/~jdv/8191073/webrev.01/ 

 

Thanks,

Jay

 

From: Brian Burkhalter 
Sent: Saturday, January 06, 2018 4:43 AM
To: Jayathirth D V
Cc: 2d-dev
Subject: Re: [OpenJDK 2D-Dev] [11] RFR JDK-8191073: JpegImageReader throws IndexOutOfBoundsException when trying to read image data from tables-only image

 

Hi Jay,

 

On Jan 3, 2018, at 11:06 PM, Jayathirth D V <HYPERLINK "mailto:jayathirth.d.v at oracle.com"jayathirth.d.v at oracle.com> wrote:





Bug : https://bugs.openjdk.java.net/browse/JDK-8191073

Webrev : http://cr.openjdk.java.net/~jdv/8191073/webrev.00/

 

General comment: I think it's better to use "//" than "/*.*/" for method-internal comments:

 

JpegImageReader L373-375, 392-397, 516-519

JpegTablesOnlyReadTest L61-64

 

As to the fix, is the new tablesOnlyStream boolean really necessary? For example at line 520 in the new version could not one do this

        if (imagePositions.isEmpty()) { // line 520 of new version
            throw new IIOException("No image data present to read");
        }

instead? I don't see where the value of this variable is used anywhere else.

 

Thanks,

 

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180107/7749da2d/attachment-0001.html>


More information about the 2d-dev mailing list