projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3865924
)
python/ext/py-source.c: check seek is not negative
author
Paul Brossier
<piem@piem.org>
Sat, 14 May 2016 03:25:34 +0000
(
05:25
+0200)
committer
Paul Brossier
<piem@piem.org>
Sat, 14 May 2016 03:25:34 +0000
(
05:25
+0200)
python/ext/py-source.c
patch
|
blob
|
history
diff --git
a/python/ext/py-source.c
b/python/ext/py-source.c
index
b946070
..
8280868
100644
(file)
--- 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;
+
in
t 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,