blob: 02c987a8832dc97251e4550f971e469e296ac8a4 [file] [log] [blame] [edit]
---
Lib/wave.py | 2 ++
1 file changed, 2 insertions(+)
Index: Python-2.7.16/Lib/wave.py
===================================================================
--- Python-2.7.16.orig/Lib/wave.py
+++ Python-2.7.16/Lib/wave.py
@@ -272,6 +272,8 @@ class Wave_read:
self._sampwidth = (sampwidth + 7) // 8
else:
raise Error, 'unknown format: %r' % (wFormatTag,)
+ if self._nchannels == 0:
+ raise ValueError("The audio file in wav format should have at least one channel!")
self._framesize = self._nchannels * self._sampwidth
self._comptype = 'NONE'
self._compname = 'not compressed'