History

python/ext/py-source.c: check seek is not negative

Paul Brossier committed 10 years ago

Commit a2ab20a1 parent 38659241 file · +8 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/py-source.c+8−1
@@ -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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t