Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Melnichek <melnichek@gmail.com>2011-01-30 20:14:28 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:11:17 +0300
commite3ea9112672f568e5a65934c7c2ead72e47d48c5 (patch)
treee4e77e97e9e43ff6ffbc6dab69ce7ba40fef1c08 /indexer/cell_coverer.hpp
parent58dd7df7242ab18f2ea62b2898c4a2b16a4edb8b (diff)
Fix crash when trying to cover rects beyond world bounds.
Diffstat (limited to 'indexer/cell_coverer.hpp')
-rw-r--r--indexer/cell_coverer.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/indexer/cell_coverer.hpp b/indexer/cell_coverer.hpp
index 8afc068e53..fd98a88b62 100644
--- a/indexer/cell_coverer.hpp
+++ b/indexer/cell_coverer.hpp
@@ -156,6 +156,9 @@ inline void CoverRect(CoordT minX, CoordT minY,
if (maxX > BoundsT::maxX) maxX = BoundsT::maxX;
if (maxY > BoundsT::maxY) maxY = BoundsT::maxY;
+ if (minX >= maxX || minY >= maxY)
+ return;
+
CellIdT commonCell =
CellIdConverter<BoundsT, CellIdT>::Cover2PointsWithCell(minX, minY, maxX, maxY);