diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-07-19 16:01:24 +0200 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2016-07-19 13:31:11 -0500 |
commit | 6e830725de430de6aa573955769916edcb878e33 (patch) | |
tree | 0238229ac692e33a0ab422efcf4c93fe78838b0b /src | |
parent | a8cd7ecdfbf9410bf4919238eed40de1767a1225 (diff) | |
download | qtlocation-mapboxgl-6e830725de430de6aa573955769916edcb878e33.tar.gz |
[android] #5725 - Cherry picking 559f3a654b976d41d0f3db3fa958ebcda3e97b1c
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/util/mapbox.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mbgl/util/mapbox.cpp b/src/mbgl/util/mapbox.cpp index 41959563f0..15c369a995 100644 --- a/src/mbgl/util/mapbox.cpp +++ b/src/mbgl/util/mapbox.cpp @@ -82,10 +82,18 @@ std::string normalizeSpriteURL(const std::string& url, const std::string& access std::string id, extension; if (isDraft) { size_t index = pathname[3].find_first_of("@."); + if (index == std::string::npos) { + Log::Error(Event::ParseStyle, "Invalid sprite URL"); + return url; + } id = pathname[2]; extension = pathname[3].substr(index); } else { size_t index = pathname[2].find_first_of("@."); + if (index == std::string::npos) { + Log::Error(Event::ParseStyle, "Invalid sprite URL"); + return url; + } id = pathname[2].substr(0, index); extension = pathname[2].substr(index); } |