Mercurial > libavformat.hg
changeset 4032:7c85b7921e61 libavformat
Change status packet skipping to be more spec-compliant. See discussion in
"[PATCH] RDT/Realmedia patches #2" thread on ML.
author | rbultje |
---|---|
date | Sat, 15 Nov 2008 20:45:26 +0000 |
parents | cd5a6a766b14 |
children | 836e25632f0b |
files | rdt.c |
diffstat | 1 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/rdt.c Sat Nov 15 20:43:57 2008 +0000 +++ b/rdt.c Sat Nov 15 20:45:26 2008 +0000 @@ -178,10 +178,17 @@ { int consumed = 10; - if (len > 0 && (buf[0] < 0x40 || buf[0] > 0x42)) { - buf += 9; - len -= 9; - consumed += 9; + /* skip status packets */ + while (len >= 5 && buf[1] == 0xFF /* status packet */) { + int pkt_len; + + if (!(buf[0] & 0x80)) + return -1; /* not followed by a data packet */ + + pkt_len = AV_RB16(buf+3); + buf += pkt_len; + len -= pkt_len; + consumed += pkt_len; } if (len < 10) return -1;