Skip over extensions in RTP header. Ticket #388
This commit is contained in:
parent
c365f235cc
commit
98975cf4b3
1 changed files with 12 additions and 2 deletions
|
@ -124,7 +124,7 @@ iptv_ts_input(service_t *t, const uint8_t *tsb)
|
|||
static void *
|
||||
iptv_thread(void *aux)
|
||||
{
|
||||
int nfds, fd, r, j;
|
||||
int nfds, fd, r, j, hlen;
|
||||
uint8_t tsb[65536], *buf;
|
||||
struct epoll_event ev;
|
||||
service_t *t;
|
||||
|
@ -158,7 +158,17 @@ iptv_thread(void *aux)
|
|||
if((tsb[1] & 0x7f) != 33)
|
||||
continue;
|
||||
|
||||
int hlen = (tsb[0] & 0xf) * 4 + 12;
|
||||
hlen = (tsb[0] & 0xf) * 4 + 12;
|
||||
|
||||
if(tsb[0] & 0x10) {
|
||||
// Extension (X bit) == true
|
||||
|
||||
if(r < hlen + 4)
|
||||
continue; // Packet size < hlen + extension header
|
||||
|
||||
// Skip over extension header (last 2 bytes of header is length)
|
||||
hlen += ((tsb[hlen + 2] << 8) | tsb[hlen + 3]) * 4;
|
||||
}
|
||||
|
||||
if(r < hlen || (r - hlen) % 188 != 0)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue