shithub: aubio

Download patch

ref: 2763582da4af10d09edd4bb3f0fd91579cf396a3
parent: 6e5dd2b247b76f7135bb2a60146e0250be7dbb49
author: Paul Brossier <piem@piem.org>
date: Thu Sep 22 20:06:45 EDT 2016

src/spectral/specdesc.c: return NULL if wrong mode asked

--- a/src/spectral/specdesc.c
+++ b/src/spectral/specdesc.c
@@ -273,8 +273,9 @@
   else if (strcmp (onset_mode, "default") == 0)
       onset_type = aubio_onset_default;
   else {
-      AUBIO_ERR("unknown spectral descriptor type %s, using default.\n", onset_mode);
-      onset_type = aubio_onset_default;
+      AUBIO_ERR("unknown spectral descriptor type %s\n", onset_mode);
+      AUBIO_FREE(o);
+      return NULL;
   }
   switch(onset_type) {
     /* for both energy and hfc, only fftgrain->norm is required */