projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2296ffb
)
src/io/source_wavread.c: avoid seeking in closed file
author
Paul Brossier
<piem@piem.org>
Sun, 26 Feb 2017 22:38:49 +0000
(23:38 +0100)
committer
Paul Brossier
<piem@piem.org>
Sun, 26 Feb 2017 22:38:49 +0000
(23:38 +0100)
src/io/source_wavread.c
patch
|
blob
|
history
diff --git
a/src/io/source_wavread.c
b/src/io/source_wavread.c
index
2b7f811
..
344f9a8
100644
(file)
--- a/
src/io/source_wavread.c
+++ b/
src/io/source_wavread.c
@@
-407,6
+407,10
@@
uint_t aubio_source_wavread_get_channels(aubio_source_wavread_t * s) {
uint_t aubio_source_wavread_seek (aubio_source_wavread_t * s, uint_t pos) {
uint_t ret = 0;
+ if (s->fid == NULL) {
+ AUBIO_ERR("source_wavread: could not seek %s (file not opened?)\n", s->path, pos);
+ return AUBIO_FAIL;
+ }
if ((sint_t)pos < 0) {
AUBIO_ERR("source_wavread: could not seek %s at %d (seeking position should be >= 0)\n", s->path, pos);
return AUBIO_FAIL;