From d8fd183683b7495566b7e510a6536ae2efe8dfed Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 14 Dec 2013 14:52:31 +0100 Subject: vc1: Fix mb_height for field pictures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tables are always allocated now with sufficient space for either progressive or interlaced content. The alternative would be to detect a change and reallocate. This fixes decoding of a sample. Signed-off-by: Martin Storsjö --- libavcodec/vc1.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/vc1.c') diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index a78d23e95a..6d89e713a0 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -864,11 +864,13 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) v->fcm = fcm; if (v->field_mode) { + v->s.mb_height = FFALIGN(v->s.height + 15 >> 4, 2); v->fptype = get_bits(gb, 3); v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; if (v->fptype & 4) // B-picture v->s.pict_type = (v->fptype & 2) ? AV_PICTURE_TYPE_BI : AV_PICTURE_TYPE_B; } else { + v->s.mb_height = v->s.height + 15 >> 4; switch (get_unary(gb, 0, 4)) { case 0: v->s.pict_type = AV_PICTURE_TYPE_P; -- cgit v1.2.3