shithub: aubio

Download patch

ref: fe6a9a2395dfa9677c3583b2721a4555322039f5
parent: 7c85c153c6e39b86bdb5fbc9925839b94684bef5
author: Paul Brossier <piem@piem.org>
date: Mon Nov 26 11:29:42 EST 2018

[dct] fail ooura creation if size <= 0

--- a/src/spectral/dct_ooura.c
+++ b/src/spectral/dct_ooura.c
@@ -38,8 +38,8 @@
 
 aubio_dct_ooura_t * new_aubio_dct_ooura (uint_t size) {
   aubio_dct_ooura_t * s = AUBIO_NEW(aubio_dct_ooura_t);
-  if (aubio_is_power_of_two(size) != 1) {
-    AUBIO_ERR("dct: can only create with sizes power of two, requested %d\n",
+  if (aubio_is_power_of_two(size) != 1 || (sint_t)size <= 0) {
+    AUBIO_ERR("dct_ooura: can only create with sizes power of two, requested %d\n",
         size);
     goto beach;
   }