diff options
author | Ujjwal Verma <ujjwalverma1111@gmail.com> | 2017-06-06 03:52:36 +0530 |
---|---|---|
committer | Ujjwal Verma <ujjwalverma1111@gmail.com> | 2017-06-06 03:52:36 +0530 |
commit | 8b06dffafbdfcac24004d02aae1a0b5a36f7d931 (patch) | |
tree | 4830027697fdc59462d547b319004a009f9e4f3a /mitmproxy/contrib | |
parent | 387235b5809bc1b86f748f5da56d03eb946d1c44 (diff) | |
download | mitmproxy-8b06dffafbdfcac24004d02aae1a0b5a36f7d931.tar.gz mitmproxy-8b06dffafbdfcac24004d02aae1a0b5a36f7d931.tar.bz2 mitmproxy-8b06dffafbdfcac24004d02aae1a0b5a36f7d931.zip |
Update png.py. Stop reading after IEND
Diffstat (limited to 'mitmproxy/contrib')
-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): |