From 178c6ce9b89a57ed06a9a08cae9ac585c9c80cda Mon Sep 17 00:00:00 2001 From: hyc Date: Wed, 24 Mar 2010 18:43:30 +0000 Subject: [PATCH] Fix buffer errors git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@396 400ebc74-4327-4243-bc38-086b20814532 --- librtmp/parseurl.c | 8 ++++---- librtmp/rtmp.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/librtmp/parseurl.c b/librtmp/parseurl.c index c5ba93a..25fa33d 100644 --- a/librtmp/parseurl.c +++ b/librtmp/parseurl.c @@ -142,7 +142,7 @@ parsehost: slash3 = strchr(slash2+1, '/'); applen = end-p; // ondemand, pass all parameters as app - appnamelen = 8; // ondemand length + appnamelen = applen; // ondemand length if(ques && strstr(p, "slist=")) { // whatever it is, the '?' and slist= means we need to use everything as app and parse plapath from slist= appnamelen = ques-p; @@ -170,9 +170,9 @@ parsehost: if (*p == '/') p++; - { - AVal av = {p, end-p}; - RTMP_ParsePlaypath(&av, playpath); + if (end-p) { + AVal av = {p, end-p}; + RTMP_ParsePlaypath(&av, playpath); } return true; diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 7c13b4e..79f5c6f 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -3568,6 +3568,8 @@ RTMP_Read(RTMP *r, char *buf, int size) } r->m_read.buf += nRead; r->m_read.buflen -= nRead; + if (r->m_read.dataType == 5) + break; } mybuf[4] = r->m_read.dataType; r->m_read.buflen = r->m_read.buf - mybuf; -- 2.50.1