diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-03-18 07:55:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-18 07:55:53 (GMT) |
commit | 134cb01cda50f02725575808130b05d2d776693f (patch) | |
tree | 25cf0f7f9b0404c2e9c6addc7584a24f63f64ca6 /Lib/sunau.py | |
parent | bc300ce205f99acb1ef92c37de06dc76147e073b (diff) | |
download | cpython-134cb01cda50f02725575808130b05d2d776693f.zip cpython-134cb01cda50f02725575808130b05d2d776693f.tar.gz cpython-134cb01cda50f02725575808130b05d2d776693f.tar.bz2 |
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
Diffstat (limited to 'Lib/sunau.py')
-rw-r--r-- | Lib/sunau.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py index dbad3db..129502b 100644 --- a/Lib/sunau.py +++ b/Lib/sunau.py @@ -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) |