mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
This commit is contained in:
parent
bc300ce205
commit
134cb01cda
7 changed files with 150 additions and 7 deletions
|
@ -208,6 +208,8 @@ class Au_read:
|
|||
raise Error('unknown encoding')
|
||||
self._framerate = int(_read_u32(file))
|
||||
self._nchannels = int(_read_u32(file))
|
||||
if not self._nchannels:
|
||||
raise Error('bad # of channels')
|
||||
self._framesize = self._framesize * self._nchannels
|
||||
if self._hdr_size > 24:
|
||||
self._info = file.read(self._hdr_size - 24)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue