From 1f87c1b747d5477377cdb1f2c82935d5fc6dc87b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 30 Apr 2016 06:34:06 +0200 Subject: [PATCH] python/ext/py-fft.c: check rdo input cvec has correct size --- .travis.yml | 2 +- python/ext/py-fft.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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) ) { -- 2.11.0