[dct] fail fftw creation if size <= 0
authorPaul Brossier <piem@piem.org>
Mon, 26 Nov 2018 15:59:56 +0000 (16:59 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 26 Nov 2018 15:59:56 +0000 (16:59 +0100)
src/spectral/dct_fftw.c

index 2a4fa7a..7d6c32c 100644 (file)
@@ -63,7 +63,9 @@ struct _aubio_dct_fftw_t {
 
 aubio_dct_fftw_t * new_aubio_dct_fftw (uint_t size) {
   aubio_dct_fftw_t * s = AUBIO_NEW(aubio_dct_fftw_t);
 
 aubio_dct_fftw_t * new_aubio_dct_fftw (uint_t size) {
   aubio_dct_fftw_t * s = AUBIO_NEW(aubio_dct_fftw_t);
-  if (!s) {
+  if ((sint_t)size <= 0) {
+    AUBIO_ERR("dct_fftw: can only create with size > 0, requested %d\n",
+        size);
     goto beach;
   }
   s->size = size;
     goto beach;
   }
   s->size = size;