Commit 68ff9981 authored by Martin Storsjö's avatar Martin Storsjö

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: 's avatarMartin Storsjö <martin@martin.st>
parent 9277050e
......@@ -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 :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment