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 | 252 | uint_t err = 0; |
| 253 | 253 | |
| 254 | − uint_t position; | |
| 254 | + int position; | |
| 255 | 255 | if (!PyArg_ParseTuple (args, "I", &position)) { |
| 256 | 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 | 266 | err = aubio_source_seek(self->o, position); |
| 260 | 267 | if (err != 0) { |
| 261 | 268 | PyErr_SetString (PyExc_ValueError, |