[FFmpeg-cvslog] h261: check the mtype index

Luca Barbato git at videolan.org
Thu Sep 26 00:16:35 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Wed Aug 14 16:57:21 2013 +0200| [91355bec88ceb3622ea26f4d50126e6d5ea17d91] | committer: Sean McGovern

h261: check the mtype index

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit c59967fa7cc5bc2fa06b36c17d2c207240c06b3e)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/h261dec.c

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

 libavcodec/h261dec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 665cc0d..70347bb 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -286,6 +286,11 @@ static int h261_decode_mb(H261Context *h){
 
     // Read mtype
     h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
+    if (h->mtype < 0 || h->mtype >= FF_ARRAY_ELEMS(h261_mtype_map)) {
+        av_log(s->avctx, AV_LOG_ERROR, "Invalid mtype index %d\n",
+               h->mtype);
+        return SLICE_ERROR;
+    }
     h->mtype = h261_mtype_map[h->mtype];
 
     // Read mquant



More information about the ffmpeg-cvslog mailing list