Commit 741fa049 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_parser: more robust dimension setup

Before this missing seq headers could have led to wrong dimensions
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 14f3e8b8
......@@ -90,8 +90,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
pc->progressive_sequence = buf[1] & (1 << 3);
avctx->has_b_frames= !(buf[5] >> 7);
pc->width |=(horiz_size_ext << 12);
pc->height |=( vert_size_ext << 12);
pc->width = (pc->width & 0xFFF) | (horiz_size_ext << 12);
pc->height = (pc->height& 0xFFF) | ( vert_size_ext << 12);
bit_rate = (bit_rate&0x3FFFF) | (bit_rate_ext << 18);
if(did_set_size)
ff_set_dimensions(avctx, pc->width, pc->height);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment