[MPlayer-cvslog] r21415 - trunk/libmpeg2/header.c

henry subversion at mplayerhq.hu
Fri Dec 1 18:47:56 CET 2006


Author: henry
Date: Fri Dec  1 18:47:55 2006
New Revision: 21415

Modified:
   trunk/libmpeg2/header.c

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

Modified: trunk/libmpeg2/header.c
==============================================================================
--- trunk/libmpeg2/header.c	(original)
+++ trunk/libmpeg2/header.c	Fri Dec  1 18:47:55 2006
@@ -272,9 +272,11 @@
     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;
 }



More information about the MPlayer-cvslog mailing list