[FFmpeg-cvslog] oggspeexparse: fix array overread

Michael Niedermayer git at videolan.org
Wed Dec 12 11:39:45 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 12 11:20:55 2012 +0100| [a0f659b27575de81549e524d13457554b9095ac8] | committer: Michael Niedermayer

oggspeexparse: fix array overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/oggparsespeex.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c
index 42480a3..63e6370 100644
--- a/libavformat/oggparsespeex.c
+++ b/libavformat/oggparsespeex.c
@@ -58,6 +58,11 @@ static int speex_header(AVFormatContext *s, int idx) {
         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
         st->codec->codec_id = AV_CODEC_ID_SPEEX;
 
+        if (os->psize < 68) {
+            av_log(s, AV_LOG_ERROR, "speex packet too small\n");
+            return AVERROR_INVALIDDATA;
+        }
+
         st->codec->sample_rate = AV_RL32(p + 36);
         st->codec->channels = AV_RL32(p + 48);
         if (st->codec->channels < 1 || st->codec->channels > 2) {



More information about the ffmpeg-cvslog mailing list