Mercurial > pt1
comparison 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 |
comparison
equal
deleted
inserted
replaced
105:0a9406f92f32 | 106:12b9192becaa |
---|---|
603 uint32_t tag; | 603 uint32_t tag; |
604 uint32_t len; | 604 uint32_t len; |
605 | 605 |
606 tag = buf[p]; | 606 tag = buf[p]; |
607 len = buf[p+1]; | 607 len = buf[p+1]; |
608 | |
609 if(len == 0) | |
610 break; | |
611 | |
608 if(tag == 0x09 && len >= 4 && p+len <= N) { | 612 if(tag == 0x09 && len >= 4 && p+len <= N) { |
609 ca_pid = ((buf[p+4] << 8) | buf[p+5]) & 0x1fff; | 613 ca_pid = ((buf[p+4] << 8) | buf[p+5]) & 0x1fff; |
610 sp->pids[ca_pid] = 1; | 614 sp->pids[ca_pid] = 1; |
611 } | 615 } |
612 p += len; | 616 p += len; |