diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-08-14 16:57:21 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-08-24 16:50:12 +0200 |
commit | a14ff5b2569de04c974302368d35a4ae62b95f86 (patch) | |
tree | 4e1507adaa37dbe93e3d61468d6140b6e998e2a0 /libavcodec | |
parent | 7c30ea500640e85a04ad5610197059b1b559a565 (diff) | |
download | ffmpeg-a14ff5b2569de04c974302368d35a4ae62b95f86.tar.gz |
h261: check the mtype index
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit c59967fa7cc5bc2fa06b36c17d2c207240c06b3e)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/h261dec.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h261dec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 55453c112d..77c6cab0ec 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 |