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:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-04-05 21:33:44 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-04-06 12:00:47 +0300
commit7f86f35a6db52461d868fab8242269742e6a0a42 (patch)
treeca877530960ccd4c6f904337bac800de0cc32405 /drape_frontend/user_mark_shapes.cpp
parente017d7d798ab4901c76ea6e6ad69f5814aaf2e24 (diff)
Fixed memory corruption in user lines
Diffstat (limited to 'drape_frontend/user_mark_shapes.cpp')
-rw-r--r--drape_frontend/user_mark_shapes.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/drape_frontend/user_mark_shapes.cpp b/drape_frontend/user_mark_shapes.cpp
index 5e96e88745..3a3a0d48ab 100644
--- a/drape_frontend/user_mark_shapes.cpp
+++ b/drape_frontend/user_mark_shapes.cpp
@@ -440,6 +440,9 @@ void CacheUserLines(TileKey const & tileKey, ref_ptr<dp::TextureManager> texture
LineIDCollection const & linesId, UserLinesRenderCollection & renderParams,
dp::Batcher & batcher)
{
+ ASSERT_GREATER(tileKey.m_zoomLevel, 0, ());
+ ASSERT_LESS_OR_EQUAL(tileKey.m_zoomLevel, scales::GetUpperStyleScale(), ());
+
auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
bool const simplify = tileKey.m_zoomLevel <= kLineSimplifyLevelEnd;
@@ -493,7 +496,7 @@ void CacheUserLines(TileKey const & tileKey, ref_ptr<dp::TextureManager> texture
params.m_depth = layer.m_depth;
params.m_depthLayer = renderInfo.m_depthLayer;
params.m_width = static_cast<float>(layer.m_width * vs *
- kLineWidthZoomFactor[tileKey.m_zoomLevel]);
+ kLineWidthZoomFactor[tileKey.m_zoomLevel - 1]);
params.m_minVisibleScale = 1;
params.m_rank = 0;