]> granicus.if.org Git - rtmpdump/commitdiff
Fix buffer errors
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Wed, 24 Mar 2010 18:43:30 +0000 (18:43 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Wed, 24 Mar 2010 18:43:30 +0000 (18:43 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@396 400ebc74-4327-4243-bc38-086b20814532

librtmp/parseurl.c
librtmp/rtmp.c

index c5ba93a7931104c4fadd3f0724818a40120ddc7e..25fa33d2625ff1c2597e9fd983696fede8aa25bb 100644 (file)
@@ -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;
index 7c13b4e048007a04a94d5a100d2b7d004f40dd38..79f5c6f6b9ee13752f5e99e0e3559012a2484cf3 100644 (file)
@@ -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;