summaryrefslogtreecommitdiff
path: root/Lib/sunau.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-03-18 09:55:53 +0200
committerGitHub <noreply@github.com>2018-03-18 09:55:53 +0200
commit134cb01cda50f02725575808130b05d2d776693f (patch)
tree25cf0f7f9b0404c2e9c6addc7584a24f63f64ca6 /Lib/sunau.py
parentbc300ce205f99acb1ef92c37de06dc76147e073b (diff)
downloadcpython-git-134cb01cda50f02725575808130b05d2d776693f.tar.gz
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
Diffstat (limited to 'Lib/sunau.py')
-rw-r--r--Lib/sunau.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py
index dbad3db839..129502b0b4 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)