projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fdeba11
)
src/io/sink_wavwrite.c: fail if samplerate is way too large
author
Paul Brossier
<piem@piem.org>
Sat, 31 Jan 2015 11:15:33 +0000
(12:15 +0100)
committer
Paul Brossier
<piem@piem.org>
Sat, 31 Jan 2015 11:15:33 +0000
(12:15 +0100)
src/io/sink_wavwrite.c
patch
|
blob
|
history
diff --git
a/src/io/sink_wavwrite.c
b/src/io/sink_wavwrite.c
index
4c0e23d
..
7d832d0
100644
(file)
--- a/
src/io/sink_wavwrite.c
+++ b/
src/io/sink_wavwrite.c
@@
-101,6
+101,8
@@
aubio_sink_wavwrite_t * new_aubio_sink_wavwrite(char_t * path, uint_t samplerate
if ((sint_t)samplerate < 0) goto beach;
// zero samplerate given. do not open yet
if ((sint_t)samplerate == 0) return s;
if ((sint_t)samplerate < 0) goto beach;
// zero samplerate given. do not open yet
if ((sint_t)samplerate == 0) return s;
+ // samplerate way too large, fail
+ if ((sint_t)samplerate > 192000 * 4) goto beach;
s->samplerate = samplerate;
s->channels = 1;
s->samplerate = samplerate;
s->channels = 1;