python/ext/py-fft.c: check rdo input cvec has correct size
authorPaul Brossier <piem@piem.org>
Sat, 30 Apr 2016 04:34:06 +0000 (06:34 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 30 Apr 2016 04:34:06 +0000 (06:34 +0200)
.travis.yml
python/ext/py-fft.c

index 009c4a2..9bd6a81 100644 (file)
@@ -63,7 +63,7 @@ addons:
     - sox
 
 script:
-  - make create_test_sounds
+  - echo make create_test_sounds disabled for now
   - make build
   - make build_python
   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make test_python; fi
index de05ef7..292d859 100644 (file)
@@ -121,6 +121,13 @@ Py_fft_rdo(Py_fft * self, PyObject * args)
     return NULL;
   }
 
+  if (self->cvecin.length != self->win_s / 2 + 1) {
+    PyErr_Format(PyExc_ValueError,
+                 "input array has length %d, but fft input has size %d",
+                 self->vecin.length, self->win_s / 2 + 1);
+    return NULL;
+  }
+
   fvec_t out;
   Py_INCREF(self->rdoout);
   if (!PyAubio_ArrayToCFvec(self->rdoout, &out) ) {