[MPlayer-cvslog] r20503 - trunk/libmpdemux/demux_ts.c

nicodvb subversion at mplayerhq.hu
Sun Oct 29 11:55:02 CET 2006


Author: nicodvb
Date: Sun Oct 29 11:55:02 2006
New Revision: 20503

Modified:
   trunk/libmpdemux/demux_ts.c

Log:
1000l: fixed broken handling of the adaption field - part 2
The value of c must be between 0 and 183 inclusive; is c is 0
I can't skip c-1 bytes!


Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c	(original)
+++ trunk/libmpdemux/demux_ts.c	Sun Oct 29 11:55:02 2006
@@ -2633,14 +2633,24 @@
 			int c;
 			c = stream_read_char(stream);
 			buf_size--;
+			if(c < 0 || c > 183)	//broken from the stream layer or invalid
+			{
+				stream_skip(stream, buf_size-1+junk);
+				continue;
+			}
+			
+			//c==0 is allowed!
+			if(c > 0)
+			{
 			rap_flag = (stream_read_char(stream) & 0x40) >> 6;
 			buf_size--;
 
-			c = min(c-1, buf_size);
+			c--;
 			stream_skip(stream, c);
 			buf_size -= c;
 			if(buf_size == 0)
 				continue;
+			}
 		}
 		
 		if(bad)



More information about the MPlayer-cvslog mailing list