From: Paul Brossier Date: Mon, 26 Nov 2018 15:29:42 +0000 (+0100) Subject: [dct] fail ooura creation if size <= 0 X-Git-Tag: 0.4.9~155 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=fe6a9a2395dfa9677c3583b2721a4555322039f5;p=aubio.git [dct] fail ooura creation if size <= 0 --- diff --git a/src/spectral/dct_ooura.c b/src/spectral/dct_ooura.c index adfc4527..ba6a64b6 100644 --- a/src/spectral/dct_ooura.c +++ b/src/spectral/dct_ooura.c @@ -38,8 +38,8 @@ struct _aubio_dct_ooura_t { 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; }