From 43bacd5b7d3d265a77cd29d8abb131057796aecc Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 5 Aug 2013 06:30:24 +0200 Subject: [PATCH] vc1: check mb_height validity. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org --- libavcodec/vc1dec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 20633d7473..0feff211f2 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5966,6 +5966,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, s->uvlinesize <<= 1; } mb_height = s->mb_height >> v->field_mode; + + if (!mb_height) { + av_log(v->s.avctx, AV_LOG_ERROR, "Invalid mb_height.\n"); + goto err; + } + for (i = 0; i <= n_slices; i++) { if (i > 0 && slices[i - 1].mby_start >= mb_height) { if (v->field_mode <= 0) {