diff options
author | Anand Thakker <anandthakker@users.noreply.github.com> | 2017-06-09 06:28:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 06:28:14 -0400 |
commit | f59eb822e12b54f74e688a138dc8f4ede1feade8 (patch) | |
tree | 7d0d9039e96fd7ffef8ff89c85c7dcf639737da2 /include | |
parent | 66c2a2a0b7c42e1947f57a412ece66fa8eaac149 (diff) | |
download | qtlocation-mapboxgl-f59eb822e12b54f74e688a138dc8f4ede1feade8.tar.gz |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/style/function/composite_function.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mbgl/style/function/composite_function.hpp b/include/mbgl/style/function/composite_function.hpp index 9275ccdf8f..1b785f4670 100644 --- a/include/mbgl/style/function/composite_function.hpp +++ b/include/mbgl/style/function/composite_function.hpp @@ -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--; } |