diff options
author | Lajos Molnar <lajos@google.com> | 2014-07-14 09:35:25 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-07-16 11:45:38 -0700 |
commit | a8454c29b15748964b5eb556d1e23fbb1ee19ceb (patch) | |
tree | 25be335b129c3f8297a44fe205bb1cb8aa9c8d3f | |
parent | dcb162f3aed807d1e51f29e2454ade584439992e (diff) | |
download | frameworks_av-a8454c29b15748964b5eb556d1e23fbb1ee19ceb.zip frameworks_av-a8454c29b15748964b5eb556d1e23fbb1ee19ceb.tar.gz frameworks_av-a8454c29b15748964b5eb556d1e23fbb1ee19ceb.tar.bz2 |
Fix M3UParser relative path handling.
Bug: 16017037
Change-Id: Ibfff99387fb5b3e721144a2b3f9174092d785137
-rw-r--r-- | media/libstagefright/httplive/M3UParser.cpp | 4 |
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); |