Mercurial > pt1.mumumu
changeset 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 | 0a9406f92f32 |
children | 1ccbe20c4ce5 |
files | recpt1/tssplitter_lite.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
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;