diff recpt1/tssplitter_lite.c @ 106:12b9192becaa

avoid infinite loop. length in the first descriptor loop can be zero.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 27 Feb 2010 04:10:16 +0900
parents afd25d9ebef6
children 1ccbe20c4ce5
line wrap: on
line diff
--- a/recpt1/tssplitter_lite.c	Fri Feb 26 22:58:59 2010 +0900
+++ b/recpt1/tssplitter_lite.c	Sat Feb 27 04:10:16 2010 +0900
@@ -605,6 +605,10 @@
 
 		tag = buf[p];
 		len = buf[p+1];
+
+		if(len == 0)
+			break;
+
 		if(tag == 0x09 && len >= 4 && p+len <= N) {
 			ca_pid = ((buf[p+4] << 8) | buf[p+5]) & 0x1fff;
 			sp->pids[ca_pid] = 1;