Commit 33f10546 authored by Anton Khirnov's avatar Anton Khirnov

vc1: check that slices have a positive height

Fixes possible invalid reads.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
parent 09b23786
......@@ -881,6 +881,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
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);
if (s->end_mb_y <= s->start_mb_y) {
av_log(v->s.avctx, AV_LOG_ERROR, "Invalid slice size\n");
goto err;
}
ff_vc1_decode_blocks(v);
if (i != n_slices)
s->gb = slices[i].gb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment