[OpenJDK 2D-Dev] RFR: 8238842: AIOOBE in GIFImageReader.initializeStringTable

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Wed Feb 12 21:36:34 UTC 2020


+1

On 2/12/20 12:07 pm, Phil Race wrote:
>  > I assume the test fails without the source change.
> 
> Yes, it fails without the fix.
> 
> Also I should mention I ran all our Image I/O regression tests and they all pass.
> Of course only some fraction of those test the GIF decoding path.
> 
> -phil.
> 
> On 2/12/2020 11:55 AM, Brian Burkhalter wrote:
>>
>>
>>> On Feb 12, 2020, at 11:25 AM, Phil Race <philip.race at oracle.com <mailto:philip.race at oracle.com>> wrote:
>>>
>>> Bug:https://bugs.openjdk.java.net/browse/JDK-8238842
>>> Webrev:http://cr.openjdk.java.net/~prr/8238842/
>>>
>>> The string table has a maximum size of 4096 - by GIF spec as well as in the implementation
>>> The value initCodeSize (as a power of 2) to initialise the string table, and since GIF
>>> only allows 8bpp, this ought to max out at 256.
>>>
>>> But there's no check so we can get an ArrayIndexOutOfBoundsException
>>> This is now checked for.
>>
>> Looks good.
>>
>>> Also I removed a printStackTrace which briefly confused me during debugging
>>> as I had no idea where the message was coming from.
>>
>> I saw.
>>
>>> See the bug for more details.
>>
>> I assume the test fails without the source change.
>>
>> Brian
> 
> 


-- 
Best regards, Sergey.


More information about the 2d-dev mailing list