diff options
author | Maximilian Hils <git@maximilianhils.com> | 2018-01-11 14:11:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-11 14:11:40 +0100 |
commit | b7db304dde0daf2b410dc36d33a24856aa22ba59 (patch) | |
tree | 3c9c883e987064ec33831d722f2f40ec4f3f5546 | |
parent | a07d52daae96e13856f7c2feb51435ed0e64aed5 (diff) | |
parent | 737c74b010cd6069beae092e0cc319ee4cb6e35b (diff) | |
download | mitmproxy-b7db304dde0daf2b410dc36d33a24856aa22ba59.tar.gz mitmproxy-b7db304dde0daf2b410dc36d33a24856aa22ba59.tar.bz2 mitmproxy-b7db304dde0daf2b410dc36d33a24856aa22ba59.zip |
Merge pull request #2784 from ujjwal96/kaitai
Update GIF parser
-rw-r--r-- | mitmproxy/contrib/kaitaistruct/gif.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mitmproxy/contrib/kaitaistruct/gif.py b/mitmproxy/contrib/kaitaistruct/gif.py index 820df568..76d7fc16 100644 --- a/mitmproxy/contrib/kaitaistruct/gif.py +++ b/mitmproxy/contrib/kaitaistruct/gif.py @@ -35,9 +35,11 @@ class Gif(KaitaiStruct): self.global_color_table = self._root.ColorTable(io, self, self._root) self.blocks = [] - while not self._io.is_eof(): - self.blocks.append(self._root.Block(self._io, self, self._root)) - + while True: + _ = self._root.Block(self._io, self, self._root) + self.blocks.append(_) + if ((self._io.is_eof()) or (_.block_type == self._root.BlockType.end_of_file)) : + break class ImageData(KaitaiStruct): def __init__(self, _io, _parent=None, _root=None): |