projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
53bb4da
)
src/io/source_sndfile.c: make sure seek position is >= 0
author
Paul Brossier
<piem@piem.org>
Sun, 26 Feb 2017 22:36:21 +0000
(23:36 +0100)
committer
Paul Brossier
<piem@piem.org>
Sun, 26 Feb 2017 22:36:21 +0000
(23:36 +0100)
src/io/source_sndfile.c
patch
|
blob
|
history
diff --git
a/src/io/source_sndfile.c
b/src/io/source_sndfile.c
index
7673593
..
4c830ba
100644
(file)
--- a/
src/io/source_sndfile.c
+++ b/
src/io/source_sndfile.c
@@
-300,6
+300,11
@@
uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) {
s->path);
return AUBIO_FAIL;
}
+ if ((sint_t)pos < 0) {
+ AUBIO_ERR("source_sndfile: could not seek %s at %d (seeking position"
+ " should be >= 0)\n", s->path, pos);
+ return AUBIO_FAIL;
+ }
sf_ret = sf_seek (s->handle, resampled_pos, SEEK_SET);
if (sf_ret == -1) {
AUBIO_ERR("source_sndfile: Failed seeking %s at %d: %s\n", s->path, pos, sf_strerror (NULL));