summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-07-16 19:00:06 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-16 19:00:06 +0000
commita7df5777b89d78260d452dc1b334c4845e6d6efe (patch)
tree1e5b4cc749d334cfacbf636c4f65275e32cee67b
parent5691bf86453441a6c388d9ef9be5f21195bc3b0a (diff)
parentd323223d210aa3dcb8691c9eea4622b66c18ea83 (diff)
downloadframeworks_av-a7df5777b89d78260d452dc1b334c4845e6d6efe.zip
frameworks_av-a7df5777b89d78260d452dc1b334c4845e6d6efe.tar.gz
frameworks_av-a7df5777b89d78260d452dc1b334c4845e6d6efe.tar.bz2
am d323223d: am a8454c29: Fix M3UParser relative path handling.
* commit 'd323223d210aa3dcb8691c9eea4622b66c18ea83': Fix M3UParser relative path handling.
-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 281e0da..4f7668c 100644
--- a/media/libstagefright/httplive/M3UParser.cpp
+++ b/media/libstagefright/httplive/M3UParser.cpp
@@ -413,6 +413,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.
@@ -457,7 +459,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);