diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-31 03:00:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-31 03:00:35 +0200 |
commit | 3b5ba60aa76cb2701521aed546b3a3b174960bc4 (patch) | |
tree | ecef5354b6638c6c3c5fdf389f3b6e3e08d3c3fb /libavcodec/vc1.c | |
parent | 30c8573dc7d6556096103d5376aa6dea3216b0a7 (diff) | |
download | ffmpeg-3b5ba60aa76cb2701521aed546b3a3b174960bc4.tar.gz |
vc1dec: fix handling of max_coded dimensions
Fixes Ticket1502
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r-- | libavcodec/vc1.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index d2bcc6af50..955dfa71dc 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -418,7 +418,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) { - int w, h; v->res_rtm_flag = 1; v->level = get_bits(gb, 3); if (v->level >= 5) { @@ -437,9 +436,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) v->bitrtq_postproc = get_bits(gb, 5); //common v->postprocflag = get_bits1(gb); //common - w = (get_bits(gb, 12) + 1) << 1; - h = (get_bits(gb, 12) + 1) << 1; - avcodec_set_dimensions(v->s.avctx, w, h); + v->max_coded_width = (get_bits(gb, 12) + 1) << 1; + v->max_coded_height = (get_bits(gb, 12) + 1) << 1; v->broadcast = get_bits1(gb); v->interlace = get_bits1(gb); v->tfcntrflag = get_bits1(gb); @@ -528,6 +526,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) { int i; + int w,h; av_log(avctx, AV_LOG_DEBUG, "Entry point: %08X\n", show_bits_long(gb, 32)); v->broken_link = get_bits1(gb); @@ -551,10 +550,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex } if(get_bits1(gb)){ - int w = (get_bits(gb, 12)+1)<<1; - int h = (get_bits(gb, 12)+1)<<1; - avcodec_set_dimensions(avctx, w, h); + w = (get_bits(gb, 12)+1)<<1; + h = (get_bits(gb, 12)+1)<<1; + } else { + w = v->max_coded_width; + h = v->max_coded_height; } + avcodec_set_dimensions(avctx, w, h); if (v->extended_mv) v->extended_dmv = get_bits1(gb); if ((v->range_mapy_flag = get_bits1(gb))) { |