From: Paul Brossier Date: Sat, 14 May 2016 03:25:34 +0000 (+0200) Subject: python/ext/py-source.c: check seek is not negative X-Git-Tag: 0.4.4~300^2~46 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=a2ab20a09888a88a7b58838474c13a29fa7188a7;p=aubio.git python/ext/py-source.c: check seek is not negative --- diff --git a/python/ext/py-source.c b/python/ext/py-source.c index b9460702..82808686 100644 --- a/python/ext/py-source.c +++ b/python/ext/py-source.c @@ -251,11 +251,18 @@ Pyaubio_source_seek (Py_source *self, PyObject *args) { uint_t err = 0; - uint_t position; + int position; if (!PyArg_ParseTuple (args, "I", &position)) { return NULL; } + if (position < 0) { + PyErr_Format(PyExc_ValueError, + "error when seeking in source: can not seek to negative value %d", + position); + return NULL; + } + err = aubio_source_seek(self->o, position); if (err != 0) { PyErr_SetString (PyExc_ValueError,