aboutsummaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorSam Judd <judds@google.com>2014-10-22 19:22:45 -0700
committerSam Judd <judds@google.com>2014-10-22 19:22:45 -0700
commitf0c8a95c9d2ecaa085d389e4d95c80857d2f953e (patch)
treeb41809cae50185afa1d3c9ee3e0d93ac906db441 /third_party
parentf4e84300ed9c3a518f4bda4d29f417202e0e3adf (diff)
downloadglide-f0c8a95c9d2ecaa085d389e4d95c80857d2f953e.tar.gz
Return null when gif frame cannot be decoded.
More work toward #212.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java
index ac634ca6..8af39234 100644
--- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java
+++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java
@@ -250,9 +250,15 @@ public class GifDecoder {
*/
public Bitmap getNextFrame() {
if (header.frameCount <= 0 || framePointer < 0) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "unable to decode frame, frameCount=" + header.frameCount + " framePointer=" + framePointer);
+ }
status = STATUS_FORMAT_ERROR;
}
if (status == STATUS_FORMAT_ERROR || status == STATUS_OPEN_ERROR) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "Unable to decode frame, status=" + status);
+ }
return null;
}
status = STATUS_OK;
@@ -276,7 +282,9 @@ public class GifDecoder {
act[frame.transIndex] = 0;
}
if (act == null) {
- Log.w(TAG, "No Valid Color Table");
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "No Valid Color Table");
+ }
// No color table defined.
status = STATUS_FORMAT_ERROR;
return null;