From 2763582da4af10d09edd4bb3f0fd91579cf396a3 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 23 Sep 2016 00:06:45 +0200 Subject: [PATCH] src/spectral/specdesc.c: return NULL if wrong mode asked --- src/spectral/specdesc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spectral/specdesc.c b/src/spectral/specdesc.c index 138dd48f..67b95c39 100644 --- a/src/spectral/specdesc.c +++ b/src/spectral/specdesc.c @@ -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 */ -- 2.11.0