aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-14 14:52:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-14 16:50:21 +0100
commit017e234c204f8ffb5f85a073231247881be1ac6f (patch)
tree8a7deeea8daf357ec64684595ce072a0f8ec1c1f /libavcodec/vc1.c
parentc65fe9e9822cf2a04e5507ddbb7f99e4b6cd93e9 (diff)
downloadffmpeg-017e234c204f8ffb5f85a073231247881be1ac6f.tar.gz
avcodec/vc1: fix mb_height for field pictures
Fixes ticket2531 Tables are always allocated now with sufficient space for either progressive or interlaced content. The alternative would be to detect a change and reallocate. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 38e03e8f78..f20b946be6 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -860,12 +860,17 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->field_mode = field_mode;
v->fcm = fcm;
+ av_assert0( v->s.mb_height == v->s.height + 15 >> 4
+ || v->s.mb_height == FFALIGN(v->s.height + 15 >> 4, 2));
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;