From 6014dc0766ef3c1b04e7023cabcce80936c134e9 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 30 Apr 2016 06:20:41 +0200 Subject: [PATCH] python/ext/py-fft.c: check input has correct size --- python/ext/py-fft.c | 7 +++++++ 1 file changed, 7 insertions(+) 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)) { -- 2.11.0