From 767f128a9b34e0c46aa7c9db5ce04ea2b164f2f4 Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Thu, 24 Apr 2014 11:23:35 +0800 Subject: Gallery2: Fix Gallery crash when exit playing gif pic. When we press back key to exit playing gif pic,the decoder is free and set to null,which casuse this bug happened. Add a condition to avoid the NullPointerException. CRs-fixed: 653709 Change-Id: Iab299554c252c3a1c9352b498cd946cb53e47cc7 --- src/com/android/gallery3d/util/GIFView.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/com/android/gallery3d/util/GIFView.java b/src/com/android/gallery3d/util/GIFView.java index fd4a5b269..86003fb31 100755 --- a/src/com/android/gallery3d/util/GIFView.java +++ b/src/com/android/gallery3d/util/GIFView.java @@ -174,6 +174,9 @@ public class GIFView extends ImageView implements GifAction { if (!isShown() || mRedrawHandler == null) { break; } + if (mGifDecoder == null) { + return; + } GifFrame frame = mGifDecoder.next(); mCurrentImage = frame.mImage; -- cgit v1.2.3