From: Paul Brossier Date: Wed, 28 Nov 2018 02:33:01 +0000 (+0100) Subject: [utils] hist with size null fails X-Git-Tag: 0.4.9~145 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=042d77d68f9556d1ab39d20adec6292cf26fe20d;p=aubio.git [utils] hist with size null fails --- diff --git a/src/utils/hist.c b/src/utils/hist.c index 9b5ab10a..e0e24864 100644 --- a/src/utils/hist.c +++ b/src/utils/hist.c @@ -43,6 +43,9 @@ aubio_hist_t * new_aubio_hist (smpl_t flow, smpl_t fhig, uint_t nelems){ smpl_t step = (fhig-flow)/(smpl_t)(nelems); smpl_t accum = step; uint_t i; + if ((sint_t)nelems <= 0) { + return NULL; + } s->nelems = nelems; s->hist = new_fvec(nelems); s->cent = new_fvec(nelems);