From 9be6c739aca55721f0c4f4245ff851bf22f4ba1e Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 13 Jan 2011 00:16:49 +0200 Subject: [PATCH] Fix vector's out of range in drawPathTextImpl. --- yg/geometry_batcher.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yg/geometry_batcher.cpp b/yg/geometry_batcher.cpp index 5a4317f284..c26996e219 100644 --- a/yg/geometry_batcher.cpp +++ b/yg/geometry_batcher.cpp @@ -762,11 +762,8 @@ namespace yg // find first visible glyph size_t i = 0; - while (offset < 0) - { - offset += glyphs[i]->m_xAdvance; - ++i; - } + while (offset < 0 && i < count) + offset += glyphs[i++]->m_xAdvance; size_t ind = 0; m2::PointD ptOrg = arrPath[0];