shithub: aubio

Download patch

ref: 6014dc0766ef3c1b04e7023cabcce80936c134e9
parent: d03ee4b9e97ca863f60194f976f17cfd9af8bb06
author: Paul Brossier <piem@piem.org>
date: Sat Apr 30 02:20:41 EDT 2016

python/ext/py-fft.c: check input has correct size

--- a/python/ext/py-fft.c
+++ b/python/ext/py-fft.c
@@ -85,6 +85,13 @@
     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)) {