History

python/ext/py-phasevoc.c: add input size checks

Paul Brossier committed 10 years ago

Commit 99aa3531 parent 8147e031 file · +14 −0Browse files

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

Unified · Split

python/ext/py-phasevoc.c+14−0
@@ -102,6 +102,13 @@ Py_pvoc_do(Py_pvoc * self, PyObject * args) · 101 unmodified lines
102 return NULL;102 return NULL;
103 }103 }
104 104
105 if (self->vecin.length != self->hop_s) {
106 PyErr_Format(PyExc_ValueError,
107 "input fvec has length %d, but pvoc expects length %d",
108 self->vecin.length, self->hop_s);
109 return NULL;
110 }
111
105 Py_INCREF(self->output);112 Py_INCREF(self->output);
106 if (!PyAubio_PyCvecToCCvec (self->output, &(self->c_output))) {113 if (!PyAubio_PyCvecToCCvec (self->output, &(self->c_output))) {
107 return NULL;114 return NULL;
@@ -131,6 +138,13 @@ Py_pvoc_rdo(Py_pvoc * self, PyObject * args) · 23 unmodified lines
131 return NULL;138 return NULL;
132 }139 }
133 140
141 if (self->cvecin.length != self->win_s / 2 + 1) {
142 PyErr_Format(PyExc_ValueError,
143 "input cvec has length %d, but pvoc expects length %d",
144 self->cvecin.length, self->win_s / 2 + 1);
145 return NULL;
146 }
147
134 Py_INCREF(self->routput);148 Py_INCREF(self->routput);
135 if (!PyAubio_ArrayToCFvec(self->routput, &(self->c_routput)) ) {149 if (!PyAubio_ArrayToCFvec(self->routput, &(self->c_routput)) ) {
136 return NULL;150 return NULL;

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