diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 00:27:01 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 00:35:06 +0400 |
commit | 554c22c710915845834333cc3c15d449f88e353a (patch) | |
tree | 231139fa93692caf71c9199b9a28026a823150b2 /libavformat | |
parent | 4be0c6ed20f214c8dbf640722f7d0e2d00c85325 (diff) | |
parent | 9277050e2918e0a0df9689721a188a604d886616 (diff) |
Merge commit '9277050e2918e0a0df9689721a188a604d886616'
* commit '9277050e2918e0a0df9689721a188a604d886616':
vqf: Make sure sample_rate is set to a valid value
See: e481ba2ed79421d82ed631d187c05c03260c6561
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/vqf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 83ec1be1a0..cf680ffd4d 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -179,11 +179,11 @@ static int vqf_read_header(AVFormatContext *s) st->codec->sample_rate = 11025; break; default: - st->codec->sample_rate = rate_flag*1000; - if (st->codec->sample_rate <= 0) { - av_log(s, AV_LOG_ERROR, "sample rate %d is invalid\n", st->codec->sample_rate); - return -1; + if (rate_flag < 8 || rate_flag > 44) { + av_log(s, AV_LOG_ERROR, "Invalid rate flag %d\n", rate_flag); + return AVERROR_INVALIDDATA; } + st->codec->sample_rate = rate_flag*1000; break; } |