shithub: aubio

Download patch

ref: 3f512b84f0c94b21f18d5b3e70019d8691823004
parent: f98063b27bf9014142bfaae0e7a63a1d5cd49cae
author: Paul Brossier <piem@piem.org>
date: Wed Feb 8 06:58:16 EST 2017

src/pitch/pitch.c: return NULL if pitch_mode is NULL

--- a/src/pitch/pitch.c
+++ b/src/pitch/pitch.c
@@ -111,6 +111,10 @@
 {
   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)