diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-28 23:19:10 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-29 18:46:39 +0300 |
commit | 68ff9981283a56c731f00c2ee7901103665092fc (patch) | |
tree | 71481282be711c7fa900b075c94b34e8f0a486cd /libavformat/vqf.c | |
parent | 9277050e2918e0a0df9689721a188a604d886616 (diff) | |
download | ffmpeg-68ff9981283a56c731f00c2ee7901103665092fc.tar.gz |
vqf: Make sure the bitrate is in the valid range
Even if the sample rate is valid, an invalid bitrate could
pass the mode combination test below.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/vqf.c')
-rw-r--r-- | libavformat/vqf.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 162c7530d1..a43829b855 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -182,6 +182,13 @@ static int vqf_read_header(AVFormatContext *s) break; } + if (read_bitrate / st->codec->channels < 8 || + read_bitrate / st->codec->channels > 48) { + av_log(s, AV_LOG_ERROR, "Invalid bitrate per channel %d\n", + read_bitrate / st->codec->channels); + return AVERROR_INVALIDDATA; + } + switch (((st->codec->sample_rate/1000) << 8) + read_bitrate/st->codec->channels) { case (11<<8) + 8 : |