mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +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
|
@ -467,6 +467,10 @@ class Aifc_read:
|
|||
self._nframes = _read_long(chunk)
|
||||
self._sampwidth = (_read_short(chunk) + 7) // 8
|
||||
self._framerate = int(_read_float(chunk))
|
||||
if self._sampwidth <= 0:
|
||||
raise Error('bad sample width')
|
||||
if self._nchannels <= 0:
|
||||
raise Error('bad # of channels')
|
||||
self._framesize = self._nchannels * self._sampwidth
|
||||
if self._aifc:
|
||||
#DEBUG: SGI's soundeditor produces a bad size :-(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue