From: Paul Brossier Date: Sat, 30 Apr 2016 04:20:41 +0000 (+0200) Subject: python/ext/py-fft.c: check input has correct size X-Git-Tag: 0.4.4~300^2~169 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=6014dc0766ef3c1b04e7023cabcce80936c134e9;p=aubio.git python/ext/py-fft.c: check input has correct size --- diff --git a/python/ext/py-fft.c b/python/ext/py-fft.c index 93094a4b..de05ef79 100644 --- a/python/ext/py-fft.c +++ b/python/ext/py-fft.c @@ -85,6 +85,13 @@ Py_fft_do(Py_fft * self, PyObject * args) return NULL; } + if (self->vecin.length != self->win_s) { + PyErr_Format(PyExc_ValueError, + "input array has length %d, but fft has size %d", + self->vecin.length, self->win_s); + return NULL; + } + cvec_t c_out; Py_INCREF(self->doout); if (!PyAubio_PyCvecToCCvec(self->doout, &c_out)) {