aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-28 23:19:10 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:57 +0100
commitefe59ad90bce0e7d03319356b13fe83dde2eecc5 (patch)
tree344a30284aa2a6729546c5a43c7a85cce4d5d98c
parent61d56054a9d792882f18b0e6bfb6834a793efe2f (diff)
downloadffmpeg-efe59ad90bce0e7d03319356b13fe83dde2eecc5.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> (cherry picked from commit 68ff9981283a56c731f00c2ee7901103665092fc) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 60701469ab9f526841ae81444236425f87916adb)
-rw-r--r--libavformat/vqf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index a9b5ce784c..253ddec666 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -182,6 +182,13 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
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 :