shithub: aubio

Download patch

ref: 99c7aa2e3efec988a5f81018b48d9388ff24bba1
parent: 25f280f347868fc0f4ecdcb0b45d5a9400f8f772
author: Paul Brossier <piem@piem.org>
date: Mon Aug 6 10:04:48 EDT 2018

src/io/source_wavread.c: also exit if samplerate is negative (closes #188)

--- a/src/io/source_wavread.c
+++ b/src/io/source_wavread.c
@@ -195,8 +195,8 @@
     goto beach;
   }
 
-  if ( sr == 0 ) {
-    AUBIO_ERR("source_wavread: Failed opening %s (samplerate can not be 0)\n", s->path);
+  if ( (sint_t)sr <= 0 ) {
+    AUBIO_ERR("source_wavread: Failed opening %s (samplerate can not be <= 0)\n", s->path);
     goto beach;
   }