From: Paul Brossier Date: Thu, 22 Sep 2016 22:06:45 +0000 (+0200) Subject: src/spectral/specdesc.c: return NULL if wrong mode asked X-Git-Tag: 0.4.4~200 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=2763582da4af10d09edd4bb3f0fd91579cf396a3;p=aubio.git src/spectral/specdesc.c: return NULL if wrong mode asked --- 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 */