projects
/
aubio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge branch 'fix/awhitening'
[aubio.git]
/
src
/
utils
/
hist.c
diff --git
a/src/utils/hist.c
b/src/utils/hist.c
index
9b5ab10
..
2dcc443
100644
(file)
--- a/
src/utils/hist.c
+++ b/
src/utils/hist.c
@@
-43,6
+43,10
@@
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) {
+ AUBIO_FREE(s);
+ return NULL;
+ }
s->nelems = nelems;
s->hist = new_fvec(nelems);
s->cent = new_fvec(nelems);