summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-07-16 23:29:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-16 13:13:16 +0000
commitf839b8b435fbddca48ac2b65de397ea91c7260a3 (patch)
tree97d71564cd520bcb84418b9e8260646afc86d027 /media
parent787bdb33f6cdffd810dd243eedfbc0aed2c0abed (diff)
parent8c30425f9d7d5099b9e6cb0a0abd4e0b2fdd5639 (diff)
downloadframeworks_av-f839b8b435fbddca48ac2b65de397ea91c7260a3.zip
frameworks_av-f839b8b435fbddca48ac2b65de397ea91c7260a3.tar.gz
frameworks_av-f839b8b435fbddca48ac2b65de397ea91c7260a3.tar.bz2
Merge "Fix M3UParser relative path handling."
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/httplive/M3UParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/M3UParser.cpp b/media/libstagefright/httplive/M3UParser.cpp
index 20c3a76..451bc5f 100644
--- a/media/libstagefright/httplive/M3UParser.cpp
+++ b/media/libstagefright/httplive/M3UParser.cpp
@@ -398,6 +398,8 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
// Base URL must be absolute
return false;
}
+ const size_t schemeEnd = (strstr(baseURL, "//") - baseURL) + 2;
+ CHECK(schemeEnd == 7 || schemeEnd == 8);
if (!strncasecmp("http://", url, 7) || !strncasecmp("https://", url, 8)) {
// "url" is already an absolute URL, ignore base URL.
@@ -442,7 +444,7 @@ static bool MakeURL(const char *baseURL, const char *url, AString *out) {
// Check whether the found slash actually is part of the path
// and not part of the "http://".
- if (end > 6) {
+ if (end >= schemeEnd) {
out->setTo(baseURL, end);
} else {
out->setTo(baseURL);