vc1: prevent null pointer dereference on broken files

CC: libav-stable@libav.org
This commit is contained in:
Janne Grunau 2012-01-25 15:49:54 +01:00
parent cb0b284381
commit 510ef04a46

View File

@ -5709,7 +5709,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (!v->field_mode || v->second_field)
s->end_mb_y = (i == n_slices ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
else
s->end_mb_y = (i == n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
s->end_mb_y = (i <= n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
vc1_decode_blocks(v);
if (i != n_slices)
s->gb = slices[i].gb;