From: Sjoerd Mullender Date: Thu, 26 Aug 1993 14:12:07 +0000 (+0000) Subject: Fixed dealing with faulty COMM chunks. X-Git-Tag: v1.0.1~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4150ede53c42edb3e77373414f9c6ee070bfa366;p=thirdparty%2FPython%2Fcpython.git Fixed dealing with faulty COMM chunks. --- diff --git a/Lib/aifc.py b/Lib/aifc.py index 7bdb9f0f6244..2d897be80014 100644 --- a/Lib/aifc.py +++ b/Lib/aifc.py @@ -391,9 +391,6 @@ class Aifc_read: formlength = 0 break raise EOFError # different error, raise exception - formlength = formlength - 8 - chunk.chunksize - if chunk.chunksize & 1: - formlength = formlength - 1 if chunk.chunkname == 'COMM': self._read_comm_chunk(chunk) self._comm_chunk_read = 1 @@ -409,6 +406,9 @@ class Aifc_read: pass else: raise Error, 'unrecognized chunk type '+chunk.chunkname + formlength = formlength - 8 - chunk.chunksize + if chunk.chunksize & 1: + formlength = formlength - 1 if formlength > 0: chunk.skip() if not self._comm_chunk_read or not self._ssnd_chunk: