src/io/sink_apple_audio.c: avoid opening null path
[aubio.git] / src / io / sink_apple_audio.c
index 12a9716..f4e55e0 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#ifdef __APPLE__
+#ifdef HAVE_SINK_APPLE_AUDIO
 
 #include "aubio_priv.h"
 #include "fvec.h"
@@ -61,6 +61,11 @@ aubio_sink_apple_audio_t * new_aubio_sink_apple_audio(char_t * uri, uint_t sampl
   s->max_frames = MAX_SIZE;
   s->async = true;
 
+  if (uri == NULL) {
+    AUBIO_ERROR("sink_apple_audio: Aborted opening null path\n");
+    goto beach;
+  }
+
   s->samplerate = 0;
   s->channels = 0;
 
@@ -266,4 +271,4 @@ void del_aubio_sink_apple_audio(aubio_sink_apple_audio_t * s) {
   return;
 }
 
-#endif /* __APPLE__ */
+#endif /* HAVE_SINK_APPLE_AUDIO */