forked from AndDiSa/platform_manifest-Grouper-AOSP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages_apps_messaging.patch
28 lines (24 loc) · 1.15 KB
/
packages_apps_messaging.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/src/com/android/messaging/datamodel/media/GifImageResource.java b/src/com/android/messaging/datamodel/media/GifImageResource.java
index d50cf47..6801165 100644
--- a/src/com/android/messaging/datamodel/media/GifImageResource.java
+++ b/src/com/android/messaging/datamodel/media/GifImageResource.java
@@ -23,6 +23,7 @@ import android.support.rastermill.FrameSequence;
import android.support.rastermill.FrameSequenceDrawable;
import com.android.messaging.util.Assert;
+import com.android.messaging.util.LogUtil;
import java.io.IOException;
import java.io.InputStream;
@@ -55,7 +56,14 @@ public class GifImageResource extends ImageResource {
@Override
public Drawable getDrawable(Resources resources) {
- return new FrameSequenceDrawable(mFrameSequence);
+ try {
+ return new FrameSequenceDrawable(mFrameSequence);
+ } catch (final Exception e) {
+ // Malicious gif images can make platform throw different kind of exceptions. Catch
+ // them all.
+ LogUtil.e(LogUtil.BUGLE_TAG, "Error getting drawable for GIF", e);
+ return null;
+ }
}
@Override