1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

ignore invalid values in the sequence display extension (backport from 0.4.1)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21415 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
henry 2006-12-01 17:47:55 +00:00
parent 4d696cc729
commit c4a33d0dc4

View File

@ -272,9 +272,11 @@ static int sequence_display_ext (mpeg2dec_t * mpeg2dec)
if (!(buffer[2] & 2)) /* missing marker_bit */
return 1;
sequence->display_width = (buffer[1] << 6) | (buffer[2] >> 2);
sequence->display_height =
((buffer[2]& 1 ) << 13) | (buffer[3] << 5) | (buffer[4] >> 3);
if( (buffer[1] << 6) | (buffer[2] >> 2) )
sequence->display_width = (buffer[1] << 6) | (buffer[2] >> 2);
if( ((buffer[2]& 1 ) << 13) | (buffer[3] << 5) | (buffer[4] >> 3) )
sequence->display_height =
((buffer[2]& 1 ) << 13) | (buffer[3] << 5) | (buffer[4] >> 3);
return 0;
}