summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-01-25 20:04:32 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-01-27 09:27:32 +0000
commitee5bf40562aeca6fd861121ab29506cf905189f3 (patch)
tree792f8183961e639f2c284cac4748b70a7910bd60
parent8cbfb416c6cb1f60a7035d810f3ed68d3aae7bac (diff)
downloadqtlocation-ee5bf40562aeca6fd861121ab29506cf905189f3.tar.gz
Fix for index OOB
Adding a range check to prevent an index OOB error. Change-Id: I9d2d13f27755511893a0731f3cf0bb934b0a8795 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
index 31d5ebc8..a36f15b3 100644
--- a/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
+++ b/src/plugins/geoservices/osm/qgeofiletilecacheosm.cpp
@@ -318,6 +318,9 @@ QGeoTileSpec QGeoFileTileCacheOsm::filenameToTileSpec(const QString &filename) c
numbers.append(value);
}
+ if (numbers.at(0) > m_providers.size())
+ return emptySpec;
+
bool highDpi = m_providers[numbers.at(0) - 1]->isHighDpi();
if (highDpi && fields.at(1) != QLatin1Char('h'))
return emptySpec;