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:
authorExMix <rahuba.youri@mapswithme.com>2014-02-04 19:36:20 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:11:08 +0300
commit935e279ca8cfd66b7070c4020daa3377bce2cf21 (patch)
treec889989a0f335ee0b8ed1454bccb0692fe285cc0 /drape/attribute_provider.cpp
parent27763c14c97feecb1cc377ed6a63b67167d6995d (diff)
[drape] if we streams on "after end" memory, we don't create new stack pointer. New pointer can intersect with correct pointer of other object that also registered in pointer tracker
Diffstat (limited to 'drape/attribute_provider.cpp')
-rw-r--r--drape/attribute_provider.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/drape/attribute_provider.cpp b/drape/attribute_provider.cpp
index df6274f03a..1710871abd 100644
--- a/drape/attribute_provider.cpp
+++ b/drape/attribute_provider.cpp
@@ -54,12 +54,16 @@ void AttributeProvider::Advance(uint16_t vertexCount)
{
ASSERT_LESS_OR_EQUAL(vertexCount, m_vertexCount, ());
CHECK_STREAMS;
- for (size_t i = 0; i < GetStreamCount(); ++i)
+
+ if (m_vertexCount != vertexCount)
{
- const BindingInfo & info = m_streams[i].m_binding;
- uint32_t offset = vertexCount * info.GetElementSize();
- void * rawPointer = m_streams[i].m_data.GetRaw();
- m_streams[i].m_data = MakeStackRefPointer((void *)(((uint8_t *)rawPointer) + offset));
+ for (size_t i = 0; i < GetStreamCount(); ++i)
+ {
+ const BindingInfo & info = m_streams[i].m_binding;
+ uint32_t offset = vertexCount * info.GetElementSize();
+ void * rawPointer = m_streams[i].m_data.GetRaw();
+ m_streams[i].m_data = MakeStackRefPointer((void *)(((uint8_t *)rawPointer) + offset));
+ }
}
m_vertexCount -= vertexCount;