diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 3c634cc9d4..68e3212a19 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