shithub: aubio

Download patch

ref: 00c9444330525961aeeba7daafca0b8da5740ea3
parent: 5fc6e81242ca29a6fad80f7d57cd96ef65b2300f
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 22:28:05 EST 2018

[sink_apple_audio] preset_format does not fail on empty format string

--- a/src/io/sink_apple_audio.c
+++ b/src/io/sink_apple_audio.c
@@ -143,10 +143,12 @@
     // only use lossy codec for "aac"
     s->fileType = kAudioFileAIFFType;
   } else {
-    AUBIO_WRN("sink_apple_audio: could not guess format for %s,"
-       " using default (wav)\n", s->path);
     s->fileType = kAudioFileWAVEType;
-    return AUBIO_FAIL;
+    if (fmt && strnlen(fmt, PATH_MAX)) {
+      AUBIO_WRN("sink_apple_audio: could not guess format for %s,"
+         " using default (wav)\n", s->path);
+      return AUBIO_FAIL;
+    }
   }
   return AUBIO_OK;
 }