src/io/sink_wavwrite.c: fail if samplerate is way too large
authorPaul Brossier <piem@piem.org>
Sat, 31 Jan 2015 11:15:33 +0000 (12:15 +0100)
committerPaul Brossier <piem@piem.org>
Sat, 31 Jan 2015 11:15:33 +0000 (12:15 +0100)
src/io/sink_wavwrite.c

index 4c0e23d..7d832d0 100644 (file)
@@ -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;
+  // samplerate way too large, fail
+  if ((sint_t)samplerate > 192000 * 4) goto beach;
 
   s->samplerate = samplerate;
   s->channels = 1;