avcodec/mpegvideo_parser: more robust dimension setup

Before this missing seq headers could have led to wrong dimensions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-18 04:39:41 +01:00
parent 14f3e8b821
commit 741fa0493b
1 changed files with 2 additions and 2 deletions

View File

@ -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);