37742976 - Catch bad gifs
am: e0f247e399
Change-Id: I54307fd0a08e1ecc14b2f3be5b8d52fac6ff7033
This commit is contained in:
@@ -23,6 +23,7 @@ import android.support.rastermill.FrameSequence;
|
|||||||
import android.support.rastermill.FrameSequenceDrawable;
|
import android.support.rastermill.FrameSequenceDrawable;
|
||||||
|
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
|
import com.android.messaging.util.LogUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -55,7 +56,14 @@ public class GifImageResource extends ImageResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Drawable getDrawable(Resources resources) {
|
public Drawable getDrawable(Resources resources) {
|
||||||
|
try {
|
||||||
return new FrameSequenceDrawable(mFrameSequence);
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user