ref: 5fc6e81242ca29a6fad80f7d57cd96ef65b2300f
parent: 65e1ec6381c2c3695f56e05ef60917c9023f5ee1
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 18:56:51 EST 2018
[sink_sndfile] preset_format does not fail on empty format string
--- a/src/io/sink_sndfile.c
+++ b/src/io/sink_sndfile.c
@@ -136,10 +136,12 @@
} 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;
}