Fix undefined memory access in getCoveringRanges() (#9227)

* Add simple unit tests for SymbolSizeBinder

* Fix bug in symbol size uniform value calculation

For camera functions we were setting the zoom levels in "covering ranges" to
`[(zoom stop <= tile zoom), (zoom stop >= 1 + tile zoom)]`, but then evaluating
the function at `[tile_zoom, tile_zoom + 1]`.

* Check for it != end() before accessing it->first
This commit is contained in:
Anand Thakker
2017-06-09 06:28:14 -04:00
committed by GitHub
parent 66c2a2a0b7
commit f59eb822e1
4 changed files with 67 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ public:
// lower_bound yields first element >= zoom, but we want the *last*
// element <= zoom, so if we found a stop > zoom, back up by one.
if (minIt != s.stops.begin() && minIt->first > zoom) {
if (minIt != s.stops.begin() && minIt != s.stops.end() && minIt->first > zoom) {
minIt--;
}