aboutsummaryrefslogtreecommitdiff
path: root/third_party/gif_decoder/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/gif_decoder/src/main/java')
-rw-r--r--third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeader.java10
-rw-r--r--third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java6
2 files changed, 13 insertions, 3 deletions
diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeader.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeader.java
index 62879660..157ea57d 100644
--- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeader.java
+++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeader.java
@@ -11,9 +11,6 @@ import java.util.List;
public class GifHeader {
int[] gct = null;
- /**
- * Global status code of GIF data parsing.
- */
int status = GifDecoder.STATUS_OK;
int frameCount = 0;
@@ -51,4 +48,11 @@ public class GifHeader {
public int getNumFrames() {
return frameCount;
}
+
+ /**
+ * Global status code of GIF data parsing.
+ */
+ public int getStatus() {
+ return status;
+ }
}
diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java
index da723f5c..33c0c6c6 100644
--- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java
+++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifHeaderParser.java
@@ -77,6 +77,12 @@ public class GifHeaderParser {
switch (code) {
// Image separator.
case 0x2C:
+ // The graphics control extension is optional, but will always come first if it exists. If one did
+ // exist, there will be a non-null current frame which we should use. However if one did not exist,
+ // the current frame will be null and we must create it here. See issue #134.
+ if (header.currentFrame == null) {
+ header.currentFrame = new GifFrame();
+ }
readBitmap();
break;
// Extension.