projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0af9003
)
src/io/source_avcodec.c: check new_ arguments are valid
author
Paul Brossier
<piem@piem.org>
Fri, 6 Dec 2013 14:21:10 +0000
(09:21 -0500)
committer
Paul Brossier
<piem@piem.org>
Fri, 6 Dec 2013 14:21:10 +0000
(09:21 -0500)
src/io/source_avcodec.c
patch
|
blob
|
history
diff --git
a/src/io/source_avcodec.c
b/src/io/source_avcodec.c
index
428fca4
..
a53d720
100644
(file)
--- a/
src/io/source_avcodec.c
+++ b/
src/io/source_avcodec.c
@@
-62,10
+62,17
@@
struct _aubio_source_avcodec_t {
aubio_source_avcodec_t * new_aubio_source_avcodec(char_t * path, uint_t samplerate, uint_t hop_size) {
aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t);
int err;
aubio_source_avcodec_t * new_aubio_source_avcodec(char_t * path, uint_t samplerate, uint_t hop_size) {
aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t);
int err;
-
if (path == NULL) {
AUBIO_ERR("Aborted opening null path\n");
if (path == NULL) {
AUBIO_ERR("Aborted opening null path\n");
- return NULL;
+ goto beach;
+ }
+ if ((sint_t)samplerate < 0) {
+ AUBIO_ERR("Can not open %s with samplerate %d\n", path, samplerate);
+ goto beach;
+ }
+ if ((sint_t)hop_size <= 0) {
+ AUBIO_ERR("Can not open %s with hop_size %d\n", path, hop_size);
+ goto beach;
}
s->hop_size = hop_size;
}
s->hop_size = hop_size;