]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed dealing with faulty COMM chunks.
authorSjoerd Mullender <sjoerd@acm.org>
Thu, 26 Aug 1993 14:12:07 +0000 (14:12 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Thu, 26 Aug 1993 14:12:07 +0000 (14:12 +0000)
Lib/aifc.py

index 7bdb9f0f6244f04986b2129fa5b13c6af920ffe7..2d897be80014b2b84509f24ddc0e9110c9d84e20 100644 (file)
@@ -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: