diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-08 18:43:45 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-08 18:43:45 +0000 |
| commit | 2be32fca2b0255405705d168b84c0808b0acfa89 (patch) | |
| tree | 87322725938ae70eac8d317378862f76e1e973bd | |
| parent | 97abb0dd0f6277a2bae7ccfd310fad9da2c613bd (diff) | |
| parent | d2a102b3f4f063d19d4161d601e27facef7edcae (diff) | |
Merge cherrypicks of [2686743, 2686091, 2686092, 2686125, 2686126, 2686127, 2686744, 2686745, 2686543, 2686746, 2686747, 2686748, 2686749, 2686750, 2686751, 2686544, 2686545, 2686546, 2686547, 2686548, 2686549, 2686550, 2686821, 2686242, 2686243, 2686128, 2686754, 2686755, 2686551, 2686244, 2686552, 2686756, 2686265, 2686245, 2686246, 2686266, 2686096, 2686757, 2686758, 2686759, 2686900, 2686901, 2686902, 2686903, 2686904] into oc-r3-releaseo8.0
Change-Id: I2ecd9a37950bba075c9f0efff58f182070e27df2
| -rw-r--r-- | src/com/android/messaging/datamodel/media/GifImageResource.java | 10 |
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 |
