aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-07-27 00:29:24 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-07-27 00:29:24 +0000
commitaa3ee266cf7b6835693a78d0cde6ac10dd5d6600 (patch)
tree479c43cd53eeb9f8118f1fe18672ab6dc9dbc97c
parent8495e582a1ae64747005a267902b16051474458b (diff)
parent623ab5190266c2d7c0363ade1b44437881133018 (diff)
downloadMessaging-nougat-mr2-release.tar.gz
Merge cherrypicks of [2607234, 2607235, 2606313, 2607236, 2607238, 2607239, 2606314, 2606315, 2607240, 2606316, 2606317, 2607241, 2607242, 2607243, 2607244, 2607370, 2607371, 2607245, 2607246, 2607247, 2607248, 2607249, 2607372, 2607390, 2607391, 2607392, 2607393, 2607373, 2607394, 2607397, 2607398, 2607375, 2607401, 2607376, 2607402, 2607377, 2607403, 2607404, 2607378, 2607405, 2607379, 2607380, 2607381, 2607406, 2607382, 2607407, 2607408, 2607409] into nyc-mr2-releaseandroid-7.1.2_r36nougat-mr2-release
Change-Id: Ib1810b7c3069671673cd0d975f513d33e04c77b4
-rw-r--r--src/com/android/messaging/datamodel/media/GifImageResource.java10
1 files changed, 9 insertions, 1 deletions
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