aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h261dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-02 15:58:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-05-06 00:57:10 +0200
commitc785a7058aa6c4b89ea1fa02278eee88006dce45 (patch)
treec6400f975ad72ece896b5043de62052d669a143b /libavcodec/h261dec.c
parent6736de0ce628a2799ea4d1150b7a92a80f09c45a (diff)
downloadffmpeg-c785a7058aa6c4b89ea1fa02278eee88006dce45.tar.gz
h261: check mtype.
Fixes out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit ec3cd74f2dab8e3e8234ccb994132b23d3098585)
Diffstat (limited to 'libavcodec/h261dec.c')
-rw-r--r--libavcodec/h261dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 1dbd75d103..3b26e8bdbc 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -286,6 +286,10 @@ 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) {
+ av_log(s->avctx, AV_LOG_ERROR, "illegal mtype %d\n", h->mtype);
+ return SLICE_ERROR;
+ }
h->mtype = h261_mtype_map[h->mtype];
// Read mquant