diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2017-06-06 00:51:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 00:51:03 +0200 |
commit | 02232b51494a7045fdb96878234ddf92b549bf72 (patch) | |
tree | 6337f758597391d14a7c0daa726e8f9211dcc9a2 | |
parent | d2d7502ef050b2f3329de2a42b31278fd2a01400 (diff) | |
parent | 8b06dffafbdfcac24004d02aae1a0b5a36f7d931 (diff) | |
download | mitmproxy-02232b51494a7045fdb96878234ddf92b549bf72.tar.gz mitmproxy-02232b51494a7045fdb96878234ddf92b549bf72.tar.bz2 mitmproxy-02232b51494a7045fdb96878234ddf92b549bf72.zip |
Merge pull request #2379 from ujjwal96/kaitai
Update png.py. Stop reading after IEND
-rw-r--r-- | mitmproxy/contrib/kaitaistruct/png.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mitmproxy/contrib/kaitaistruct/png.py b/mitmproxy/contrib/kaitaistruct/png.py index 98a70693..45074d70 100644 --- a/mitmproxy/contrib/kaitaistruct/png.py +++ b/mitmproxy/contrib/kaitaistruct/png.py @@ -34,9 +34,11 @@ class Png(KaitaiStruct): self.ihdr = self._root.IhdrChunk(self._io, self, self._root) self.ihdr_crc = self._io.read_bytes(4) self.chunks = [] - while not self._io.is_eof(): - self.chunks.append(self._root.Chunk(self._io, self, self._root)) - + while True: + _ = self._root.Chunk(self._io, self, self._root) + self.chunks.append(_) + if ((_.type == u"IEND") or (self._io.is_eof())) : + break class Rgb(KaitaiStruct): def __init__(self, _io, _parent=None, _root=None): |