summaryrefslogtreecommitdiffstats
path: root/Modules/audioop.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-03 02:26:47 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-03 02:26:47 (GMT)
commitdaeffd2c08f8a04818b99e8342da79cf98ab730a (patch)
tree93805c11894dff76c9bc616380ba5f93e1937add /Modules/audioop.c
parent6f055e73df0846dcfed12704db9d17098f03d652 (diff)
downloadcpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.zip
cpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.tar.gz
cpython-daeffd2c08f8a04818b99e8342da79cf98ab730a.tar.bz2
audioop: adpcm2lin() and lin2adpcm() now raises a TypeError instead of a
SystemError if the state type is invalid.
Diffstat (limited to 'Modules/audioop.c')
-rw-r--r--Modules/audioop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index ae3ff06..bae4f26 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -1525,6 +1525,9 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
/* First time, it seems. Set defaults */
valpred = 0;
index = 0;
+ } else if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+ goto exit;
} else if (!PyArg_ParseTuple(state, "ii", &valpred, &index))
goto exit;
@@ -1631,6 +1634,9 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
/* First time, it seems. Set defaults */
valpred = 0;
index = 0;
+ } else if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+ goto exit;
} else if (!PyArg_ParseTuple(state, "ii", &valpred, &index))
goto exit;