penfeizhou / APNG4Android

Android animation support for APNG & Animated WebP & Gif & Animated AVIF, High performance
Apache License 2.0
570 stars 75 forks source link

IllegalArgumentException #140

Closed pantasystem closed 2 years ago

pantasystem commented 2 years ago

New Issue Checklist

Issue Info

Info Value
Device Info Pixel 6
System Version e.g. 12
APNG4Android Library Version e.g. 2.17.2
Repro rate e.g. all the time (100%)
Repro with our demo project e.g. does it happen with our demo project?
Demo project link none

Issue Description and Steps

An error occurs when loading the following image. Is it a specification that this cannot be displayed?

image url: https://s3.arkjp.net/misskey/5ed13b28-4029-4016-a4bf-0a039893ecfe.apng

stackTrace

java.lang.IllegalArgumentException: Bad position 1127835099/11998
        at java.nio.Buffer.position(Buffer.java:259)
        at java.nio.ByteBuffer.position(ByteBuffer.java:812)
        at com.github.penfeizhou.animation.io.ByteBufferReader.skip(ByteBufferReader.java:24)
        at com.github.penfeizhou.animation.io.FilterReader.skip(FilterReader.java:20)
        at com.github.penfeizhou.animation.apng.decode.Chunk.parse(Chunk.java:42)
        at com.github.penfeizhou.animation.apng.decode.APNGParser.parseChunk(APNGParser.java:136)
        at com.github.penfeizhou.animation.apng.decode.APNGParser.parse(APNGParser.java:108)
        at com.github.penfeizhou.animation.apng.decode.APNGDecoder.read(APNGDecoder.java:78)
        at com.github.penfeizhou.animation.apng.decode.APNGDecoder.read(APNGDecoder.java:27)
        at com.github.penfeizhou.animation.decode.FrameSeqDecoder$5.run(FrameSeqDecoder.java:226)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)