From 2576078e0885c1edf0dfbbcf53ede561ace1c6ad Mon Sep 17 00:00:00 2001 From: iive Date: Mon, 21 Jun 2004 16:03:55 +0000 Subject: [PATCH] width and height in seq_header could never be 0 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12618 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpeg2/header.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmpeg2/header.c b/libmpeg2/header.c index e8a39939e6..248b2e24e2 100644 --- a/libmpeg2/header.c +++ b/libmpeg2/header.c @@ -111,6 +111,10 @@ int mpeg2_header_sequence (mpeg2dec_t * mpeg2dec) i = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2]; sequence->display_width = sequence->picture_width = width = i >> 12; sequence->display_height = sequence->picture_height = height = i & 0xfff; + + if(width == 0 || height == 0) + return 1; + decoder->width = sequence->width = width = (width + 15) & ~15; decoder->height = sequence->height = height = (height + 15) & ~15; decoder->vertical_position_extension = (height > 2800);