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
251251 {
252252 uint_t err = 0;
253253
254− uint_t position;
254+ int position;
255255 if (!PyArg_ParseTuple (args, "I", &position)) {
256256 return NULL;
257257 }
258258
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+
259266 err = aubio_source_seek(self->o, position);
260267 if (err != 0) {
261268 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