On Mon, 3 Oct 2022 13:59:25 GMT, Jayathirth D V <j...@openjdk.org> wrote:

> In https://bugs.openjdk.org/browse/JDK-8270915 we have a valid GIF image 
> which was generated using a third party app, but it contains large amount of 
> Metadata(numerous Application extension blocks).
> 
> Also GIFImageReader doesn't use ignoreMetadata flag set by user while reading 
> Metadata which causes heavy memory usage in this scenario. We need to provide 
> support for ignoring metadata in GIFImageReader, so readMetadata() is updated 
> to use the "ignoreMetadata" flag and ignore all blocks except "Image 
> Descriptor" and "Graphics Control Extension".
> 
> I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() 
> where we are allocating upfront memory based on parameters from metadata. 
> Also this PR has small refactoring of import statements.
> 
> To replicate the bug we need byte stream with large amount of valid metadata, 
> so i am not able to add regression test case. I have run all javax/imageio 
> jtreg tests and there are no issues.

This pull request has now been integrated.

Changeset: 8c15f77a
Author:    Jayathirth D V <j...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/8c15f77abac0beb7f39a90fdfc5efb245b09ca32
Stats:     88 lines in 1 file changed: 39 ins; 10 del; 39 mod

8270915: GIFImageReader disregards ignoreMetadata flag which causes memory 
exhaustion

Reviewed-by: prr

-------------

PR: https://git.openjdk.org/jdk/pull/10536

Reply via email to