Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -251,11 +251,18 @@ Pyaubio_source_seek (Py_source *self, PyObject *args) · 250 unmodified lines | |||
| 251 | { | 251 | { |
| 252 | uint_t err = 0; | 252 | uint_t err = 0; |
| 253 | 253 | ||
| 254 | uint_t position; | 254 | int position; |
| 255 | if (!PyArg_ParseTuple (args, "I", &position)) { | 255 | if (!PyArg_ParseTuple (args, "I", &position)) { |
| 256 | return NULL; | 256 | return NULL; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | if (position < 0) { | ||
| 260 | PyErr_Format(PyExc_ValueError, | ||
| 261 | "error when seeking in source: can not seek to negative value %d", | ||
| 262 | position); | ||
| 263 | return NULL; | ||
| 264 | } | ||
| 265 | |||
| 259 | err = aubio_source_seek(self->o, position); | 266 | err = aubio_source_seek(self->o, position); |
| 260 | if (err != 0) { | 267 | if (err != 0) { |
| 261 | PyErr_SetString (PyExc_ValueError, | 268 | PyErr_SetString (PyExc_ValueError, |