From: Paul Brossier Date: Sat, 30 Apr 2016 04:34:06 +0000 (+0200) Subject: python/ext/py-fft.c: check rdo input cvec has correct size X-Git-Tag: 0.4.4~300^2~167 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=1f87c1b747d5477377cdb1f2c82935d5fc6dc87b;p=aubio.git python/ext/py-fft.c: check rdo input cvec has correct size --- diff --git a/.travis.yml b/.travis.yml index 009c4a21..9bd6a81e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/python/ext/py-fft.c b/python/ext/py-fft.c index de05ef79..292d8590 100644 --- a/python/ext/py-fft.c +++ b/python/ext/py-fft.c @@ -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) ) {