1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

vc1dec: dont ignore ff_vc1_parse_frame_header_advs return value

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-03-27 13:21:56 +02:00
parent e3bd61248f
commit 1acc553e54

View File

@ -5588,11 +5588,17 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
} }
if (i) { if (i) {
v->pic_header_flag = 0; v->pic_header_flag = 0;
if (v->field_mode && i == n_slices1 + 2) if (v->field_mode && i == n_slices1 + 2) {
ff_vc1_parse_frame_header_adv(v, &s->gb); if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
else if (get_bits1(&s->gb)) { av_log(v->s.avctx, AV_LOG_ERROR, "slice header damaged\n");
continue;
}
} else if (get_bits1(&s->gb)) {
v->pic_header_flag = 1; v->pic_header_flag = 1;
ff_vc1_parse_frame_header_adv(v, &s->gb); if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "slice header damaged\n");
continue;
}
} }
} }
s->start_mb_y = (i == 0) ? 0 : FFMAX(0, slices[i-1].mby_start % mb_height); s->start_mb_y = (i == 0) ? 0 : FFMAX(0, slices[i-1].mby_start % mb_height);