projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d8cedf
)
[timestretch] validate input hopsize and samplerate
author
Paul Brossier
<piem@piem.org>
Fri, 7 Dec 2018 11:18:17 +0000
(12:18 +0100)
committer
Paul Brossier
<piem@piem.org>
Fri, 7 Dec 2018 11:18:17 +0000
(12:18 +0100)
src/effects/timestretch_rubberband.c
patch
|
blob
|
history
diff --git
a/src/effects/timestretch_rubberband.c
b/src/effects/timestretch_rubberband.c
index
39be811
..
81fb2dc
100644
(file)
--- a/
src/effects/timestretch_rubberband.c
+++ b/
src/effects/timestretch_rubberband.c
@@
-65,6
+65,16
@@
new_aubio_timestretch (const char_t * mode, smpl_t stretchratio, uint_t hopsize,
p->hopsize = hopsize;
p->pitchscale = 1.;
+ if ((sint_t)hopsize <= 0) {
+ AUBIO_ERR("timestretch: hopsize should be > 0, got %d\n", hopsize);
+ goto beach;
+ }
+
+ if ((sint_t)samplerate <= 0) {
+ AUBIO_ERR("timestretch: samplerate should be > 0, got %d\n", samplerate);
+ goto beach;
+ }
+
if (stretchratio <= MAX_STRETCH_RATIO && stretchratio >= MIN_STRETCH_RATIO) {
p->stretchratio = stretchratio;
} else {