projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65e1ec6
)
[sink_sndfile] preset_format does not fail on empty format string
author
Paul Brossier
<piem@piem.org>
Thu, 20 Dec 2018 22:56:51 +0000
(23:56 +0100)
committer
Paul Brossier
<piem@piem.org>
Thu, 20 Dec 2018 22:56:51 +0000
(23:56 +0100)
src/io/sink_sndfile.c
patch
|
blob
|
history
diff --git
a/src/io/sink_sndfile.c
b/src/io/sink_sndfile.c
index
9427752
..
5b168a4
100644
(file)
--- 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;
}