aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-02 17:55:21 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-02 17:55:21 +0000
commit964045e85af85a3b12913d99c7f23cbecdeeedbf (patch)
tree479c43cd53eeb9f8118f1fe18672ab6dc9dbc97c
parent3f9821128abd66c4cd2f040d8243efb334bfad2d (diff)
parent06cbd7f26ba58399f296d85fd155442c7f2ac837 (diff)
downloadMessaging-nougat-mr1.5-release.tar.gz
Merge cherrypicks of [2647454, 2647904, 2647905, 2647455, 2648036, 2648037, 2648038, 2648039, 2648040, 2648041, 2648042, 2647918, 2647429, 2647906, 2647907, 2647951, 2647952, 2647953, 2647954, 2647955, 2648056, 2648057, 2648058, 2648059, 2648060, 2648061, 2648062, 2648063, 2648064, 2647919, 2648065, 2647908, 2648049, 2647909, 2647910, 2648066, 2648050, 2647430, 2647431, 2647432, 2647433, 2647434, 2647435, 2648076, 2648051] into nyc-mr1-security-e-releaseandroid-7.1.1_r55nougat-mr1.5-release
Change-Id: Id6379ce6a7680cd20a69d01ed27203d2220b5538
-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