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:
@@ -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--;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user