[MPlayer-cvslog] CVS: main/libmpdemux demux_ts.c,1.38,1.39

Nico Sabbi CVS syncmail at mplayerhq.hu
Sun Nov 6 17:17:20 CET 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv23237

Modified Files:
	demux_ts.c 
Log Message:
fixed possible uint8 overflow; assign progid to the newly created pmt

Index: demux_ts.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ts.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- demux_ts.c	31 Oct 2005 23:38:32 -0000	1.38
+++ demux_ts.c	6 Nov 2005 16:17:17 -0000	1.39
@@ -1529,11 +1529,13 @@
 }
 */
 
-static uint8_t collect_section(ts_section_t *section, int is_start, unsigned char *buff, int size)
+static int collect_section(ts_section_t *section, int is_start, unsigned char *buff, int size)
 {
-	uint8_t skip = 0, *ptr, tid;
+	uint8_t *ptr;
 	uint16_t tlen;
+	int skip, tid;
 	
+	mp_msg(MSGT_DEMUX, MSGL_V, "COLLECT_SECTION, start: %d, size: %d, collected: %d\n", is_start, size, section->buffer_len);
 	if(! is_start && !section->buffer_len)
 		return 0;
 	
@@ -1567,7 +1569,7 @@
 	ptr = &(section->buffer[skip + 1]);
 	tid = ptr[0];
 	tlen = ((ptr[1] & 0x0f) << 8) | ptr[2];
-	mp_msg(MSGT_DEMUX, MSGL_V, "SKIP: %d+1, TID: %d, TLEN: %d\n", skip, tid, tlen);
+	mp_msg(MSGT_DEMUX, MSGL_V, "SKIP: %d+1, TID: %d, TLEN: %d, COLLECTED: %d\n", skip, tid, tlen, section->buffer_len);
 	if(section->buffer_len < (skip+1+3+tlen))
 	{
 		mp_msg(MSGT_DEMUX, MSGL_DBG2, "DATA IS NOT ENOUGH, NEXT TIME\n");
@@ -1579,7 +1581,7 @@
 
 static int parse_pat(ts_priv_t * priv, int is_start, unsigned char *buff, int size)
 {
-	uint8_t skip;
+	int skip;
 	unsigned char *ptr;
 	unsigned char *base;
 	int entries, i;
@@ -2207,7 +2209,8 @@
 	unsigned char *base, *es_base;
 	pmt_t *pmt;
 	int32_t idx, es_count, section_bytes;
-	uint8_t skip, m=0;
+	uint8_t m=0;
+	int skip;
 	pmt_t *tmp;
 	struct pmt_es_t *tmp_es;
 	ts_section_t *section;
@@ -2228,6 +2231,7 @@
 		idx = priv->pmt_cnt;
 		memset(&(priv->pmt[idx]), 0, sizeof(pmt_t));
 		priv->pmt_cnt++;
+		priv->pmt[idx].progid = progid;
 	}
 
 	pmt = &(priv->pmt[idx]);
@@ -2239,8 +2243,6 @@
 		
 	base = &(section->buffer[skip]);
 
-	pmt->progid = progid;
-
 	mp_msg(MSGT_DEMUX, MSGL_V, "FILL_PMT(prog=%d), PMT_len: %d, IS_START: %d, TS_PID: %d, SIZE=%d, M=%d, ES_CNT=%d, IDX=%d, PMT_PTR=%p\n",
 		progid, pmt->section.buffer_len, is_start, pid, size, m, pmt->es_cnt, idx, pmt);
 




More information about the MPlayer-cvslog mailing list