[FFmpeg-cvslog] vqf: Make sure the bitrate is in the valid range

Martin Storsjö git at videolan.org
Thu Jan 16 22:29:49 CET 2014


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Sat Sep 28 23:19:10 2013 +0300| [efe59ad90bce0e7d03319356b13fe83dde2eecc5] | committer: Luca Barbato

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 at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 68ff9981283a56c731f00c2ee7901103665092fc)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
(cherry picked from commit 60701469ab9f526841ae81444236425f87916adb)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=efe59ad90bce0e7d03319356b13fe83dde2eecc5
---

 libavformat/vqf.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index a9b5ce7..253ddec 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 :



More information about the ffmpeg-cvslog mailing list