diff options
author | montellese <montellese@xbmc.org> | 2014-03-03 23:43:01 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2014-03-04 08:45:43 +0100 |
commit | dc81892db570d373b489f860de8265551b9ab37b (patch) | |
tree | 6d0d486d2f0c419ddeee918391e6cb7b6dbe9c40 | |
parent | 2f72ec5b364741e4a891f94382bef10217be1f57 (diff) |
URIUtils: fix out of range exception in resolvePath()
-rw-r--r-- | xbmc/utils/URIUtils.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index ea4ff97371..12dadbadac 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -1226,10 +1226,12 @@ std::string URIUtils::resolvePath(const std::string &path) CStdString realPath; int i = 0; // re-add any / or \ at the beginning - while (path.at(i) == delim.at(0)) + for (std::string::const_iterator itPath = path.begin(); itPath != path.end(); ++itPath) { + if (*itPath != delim.at(0)) + break; + realPath += delim; - i++; } // put together the path realPath += StringUtils::Join(realParts, delim); |