From: Paul Brossier Date: Wed, 8 Feb 2017 10:58:16 +0000 (+0100) Subject: src/pitch/pitch.c: return NULL if pitch_mode is NULL X-Git-Tag: 0.4.5~101 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=3f512b84f0c94b21f18d5b3e70019d8691823004;p=aubio.git src/pitch/pitch.c: return NULL if pitch_mode is NULL --- diff --git a/src/pitch/pitch.c b/src/pitch/pitch.c index e0918712..9febb365 100644 --- a/src/pitch/pitch.c +++ b/src/pitch/pitch.c @@ -111,6 +111,10 @@ new_aubio_pitch (const char_t * pitch_mode, { aubio_pitch_t *p = AUBIO_NEW (aubio_pitch_t); aubio_pitch_type pitch_type; + if (pitch_mode == NULL) { + AUBIO_ERR ("pitch: can not use ‘NULL‘ for pitch detection method\n"); + goto beach; + } if (strcmp (pitch_mode, "mcomb") == 0) pitch_type = aubio_pitcht_mcomb; else if (strcmp (pitch_mode, "yinfft") == 0)