[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Re: RFR: 8267314: Loading some animated GIFs fails with ArrayIndexOutOfBoundsException: Index 4096 o
From: Ambarish Rapte <arapte () openjdk ! java ! net>
Date: 2021-05-26 11:36:14
Message-ID: rg2slvaWo-rZv1Vr6UHrHeI7IndUrJUgmUxBQ3Sc1JE=.aab935b8-769e-449f-8e57-83e3192e72e6 () github ! com
[Download RAW message or body]
On Fri, 21 May 2021 19:24:19 GMT, Jose Pereda <jpereda@openjdk.org> wrote:
> > This PR limits the `tableIndex` value, used by the LZWDecoder algorithm in \
> > `GIFImageLoader2`, to avoid a potential AIOOB exception that happens on some \
> > animated GIFs, to the maximum size of the tables used (4096).
> > In some occasions loading an animated GIF like the one used in the included test, \
> > doesn't throw such exception, because we `allow partially loaded animated images` \
> > in `ImageStorage`, but only a few frames are loaded.
> > In theory, greater values of such index would operate over completely full \
> > tables, so there is no need to add new values in this case, and therefore, there \
> > is no risk in limiting the value to 4096.
> > This PR will prevent the exception and all the frames should load. The included \
> > test passes now (and fails loading only 10 frames out of 44 without the proposed \
> > fix).
>
> Jose Pereda has updated the pull request incrementally with one additional commit \
> since the last revision:
> Modify test to avoid online resources
Looks good to me. Did sanity check by loading different sized gif images.
-------------
Marked as reviewed by arapte (Reviewer).
PR: https://git.openjdk.java.net/jfx/pull/513
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic