From: Paul Brossier Date: Thu, 20 Dec 2018 22:56:51 +0000 (+0100) Subject: [sink_sndfile] preset_format does not fail on empty format string X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=5fc6e81242ca29a6fad80f7d57cd96ef65b2300f;p=aubio.git [sink_sndfile] preset_format does not fail on empty format string --- diff --git a/src/io/sink_sndfile.c b/src/io/sink_sndfile.c index 94277529..5b168a4b 100644 --- a/src/io/sink_sndfile.c +++ b/src/io/sink_sndfile.c @@ -136,10 +136,12 @@ uint_t aubio_sink_sndfile_preset_format(aubio_sink_sndfile_t *s, } else if (atoi(fmt) > 0x010000) { s->format = atoi(fmt); } else { - AUBIO_WRN("sink_sndfile: could not guess format for %s," - " using default (wav)\n", s->path); s->format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; - return AUBIO_FAIL; + if (fmt && strnlen(fmt, PATH_MAX)) { + AUBIO_WRN("sink_sndfile: could not guess format %s for %s," + " using default (wav)\n", fmt, s->path); + return AUBIO_FAIL; + } } return AUBIO_OK; }