summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2008-11-15 20:45:26 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2008-11-15 20:45:26 +0000
commite3b7216b9b275e77db4badd764ebe819fb6293b6 (patch)
tree3ea9425a29174f5fcc23ed5f78d9fdcb05b632dd /libavformat
parent108cd247934f640f3719ebddcb5fd6be36d4f529 (diff)
Change status packet skipping to be more spec-compliant. See discussion in
"[PATCH] RDT/Realmedia patches #2" thread on ML. Originally committed as revision 15836 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rdt.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index b44ede94b4..0982d62a1f 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -178,10 +178,17 @@ ff_rdt_parse_header(const uint8_t *buf, int len,
{
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;