aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-05 06:30:24 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-24 16:18:19 +0200
commitb26c9f4e522040b24580554f06a2376de3d00b24 (patch)
tree57adb9e87539f158d8c262abfd917c82960519e3
parent937cedd7c0ca98d183ceaf650f0dad1aab1b75a5 (diff)
downloadffmpeg-b26c9f4e522040b24580554f06a2376de3d00b24.tar.gz
vc1: check mb_height validity.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 43bacd5b7d3d265a77cd29d8abb131057796aecc) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/vc1dec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e24a15380e..bafd6a2f8c 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5594,6 +5594,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
v->mv_f[1] = tmp[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) {