bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.62k stars 6.12k forks source link

StandardGifDecoder throws ArrayIndexOutOfBoundsException #4645

Open PeralHuang opened 3 years ago

PeralHuang commented 3 years ago

Glide Version: 4.12.0

StandardGifDecoder throws ArrayIndexOutOfBoundsException when load a GIF.

java.lang.ArrayIndexOutOfBoundsException: length=40000; index=40000 at com.bumptech.glide.gifdecoder.StandardGifDecoder.setPixels(StandardGifDecoder.java:467) at com.bumptech.glide.gifdecoder.StandardGifDecoder.getNextFrame(StandardGifDecoder.java:291) at com.bumptech.glide.load.resource.gif.GifFrameResourceDecoder.decode(GifFrameResourceDecoder.java:31) at com.bumptech.glide.load.resource.gif.GifFrameResourceDecoder.decode(GifFrameResourceDecoder.java:16) at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92) at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70) at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59) at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76) at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57) at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:529) at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:493) at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:479) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:430) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:394) at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148) at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76) at com.bumptech.glide.load.model.UnitModelLoader$UnitFetcher.loadData(UnitModelLoader.java:55) at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:277) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)

1631784835114

sjudd commented 3 years ago

Was this a crash? Or just a logged exception?

PeralHuang commented 3 years ago

Was this a crash? Or just a logged exception?

This is a logged exception,gif can't play normally, but play normally on iOS and web.

sjudd commented 3 years ago

Hmm it looks like a corrupt gif, even if it is playable on other platforms. I think this is ok, though if you have some idea on a safe fallback mechanism for the code that's throwing let me know.