src/spectral/specdesc.c: return NULL if wrong mode asked
authorPaul Brossier <piem@piem.org>
Thu, 22 Sep 2016 22:06:45 +0000 (00:06 +0200)
committerPaul Brossier <piem@piem.org>
Thu, 22 Sep 2016 22:06:45 +0000 (00:06 +0200)
src/spectral/specdesc.c

index 138dd48..67b95c3 100644 (file)
@@ -273,8 +273,9 @@ new_aubio_specdesc (const char_t * onset_mode, uint_t size){
   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 */