diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-27 13:21:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-27 13:22:28 +0200 |
commit | 1acc553e5480cc16b6a9a193de581ec8fc01dff8 (patch) | |
tree | fd4bf76208fde0522c8b9f94d69a65080e0dff24 /libavcodec/vc1dec.c | |
parent | e3bd61248f908c96252877f8a0d6294ea0a91de5 (diff) | |
download | ffmpeg-1acc553e5480cc16b6a9a193de581ec8fc01dff8.tar.gz |
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>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 079ff5e857..d538c74c3e 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5588,11 +5588,17 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, } if (i) { v->pic_header_flag = 0; - if (v->field_mode && i == n_slices1 + 2) - ff_vc1_parse_frame_header_adv(v, &s->gb); - else if (get_bits1(&s->gb)) { + if (v->field_mode && i == n_slices1 + 2) { + if (ff_vc1_parse_frame_header_adv(v, &s->gb) < 0) { + av_log(v->s.avctx, AV_LOG_ERROR, "slice header damaged\n"); + continue; + } + } else if (get_bits1(&s->gb)) { 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); |