penfeizhou / APNG4Android

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

NPE #153

Closed cislone closed 2 years ago

cislone commented 2 years ago

New Issue Checklist

Issue Info

Info Value
Device Info e.g. Huawei Mate 30 pro
System Version e.g. 6.0
APNG4Android Library Version e.g. 1.0.0
Repro rate e.g. all the time (100%) / sometimes x% / only once
Repro with our demo project e.g. does it happen with our demo project?
Demo project link e.g. link to a demo project that highlights the issue

Issue Description and Steps

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

Caused by: 5 java.lang.NullPointerException:Attempt to invoke virtual method 'int java.nio.ByteBuffer.capacity()' on a null object reference 6 com.github.penfeizhou.animation.decode.FrameSeqDecoder.m(FrameSeqDecoder.java:573) 7 com.github.penfeizhou.animation.FrameAnimationDrawable.c(FrameAnimationDrawable.java:298) 8 com.github.penfeizhou.animation.glide.d$3.b(FrameDrawableTranscoder.java:97) 9 com.bumptech.glide.load.engine.n.b(EngineResource.java:62) 10 com.bumptech.glide.load.engine.b.g.a(LruResourceCache.java:40) 11 com.bumptech.glide.load.engine.b.g.a(LruResourceCache.java:11) 12 com.bumptech.glide.util.f.b(LruCache.java:117) 13 com.bumptech.glide.load.engine.b.g.b(LruResourceCache.java:11) 14 com.bumptech.glide.load.engine.i.a(Engine.java:396) 15 com.bumptech.glide.load.engine.n.h(EngineResource.java:116) 16 com.bumptech.glide.load.engine.i.a(Engine.java:362) 17 com.bumptech.glide.request.SingleRequest.b(SingleRequest.java:326) 18 com.bumptech.glide.manager.n.b(RequestTracker.java:72) 19 com.bumptech.glide.g.b(RequestManager.java:663) 20 com.bumptech.glide.g.c(RequestManager.java:631) 21 com.bumptech.glide.g.a(RequestManager.java:627) 22 com.bumptech.glide.g.onDestroy(RequestManager.java:374) 23 com.bumptech.glide.manager.a.c(ActivityFragmentLifecycle.java:65) 24 com.bumptech.glide.manager.SupportRequestManagerFragment.onDestroy(SupportRequestManagerFragment.java:215) 25 androidx.fragment.app.Fragment.performDestroy(Fragment.java:3219) 26 androidx.fragment.app.FragmentStateManager.destroy(FragmentStateManager.java:774) 27 androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:350) 28 androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112) 29 androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647) 30 androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128) 31 androidx.fragment.app.FragmentManager.dispatchDestroy(FragmentManager.java:3107) 32 androidx.fragment.app.FragmentController.dispatchDestroy(FragmentController.java:334) 33 androidx.fragment.app.FragmentActivity.onDestroy(FragmentActivity.java:330) 34 androidx.appcompat.app.AppCompatActivity.onDestroy(AppCompatActivity.java:278)

jingpeng commented 2 years ago

This NPE has already been fixed, make sure your verison of this library is latest.

jingpeng commented 2 years ago

https://github.com/penfeizhou/APNG4Android/blob/master/frameanimation/src/main/java/com/github/penfeizhou/animation/decode/FrameSeqDecoder.java#L573