From 042d77d68f9556d1ab39d20adec6292cf26fe20d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 28 Nov 2018 03:33:01 +0100 Subject: [PATCH] [utils] hist with size null fails --- src/utils/hist.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.11.0