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>2015-12-07 13:35:53 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2015-12-07 13:35:53 +0300
commitc223abc474267ab2502b4c60a868721dbc396ff7 (patch)
treeff8c0f98ffaf79c4dd136fb436d2b92145b398c6 /drape/vertex_array_buffer.cpp
parentc8ebf8832d39310fbe1bdb3855d29d11d073cd89 (diff)
Fixed crash with index buffer overflow during the buffer mutation
Diffstat (limited to 'drape/vertex_array_buffer.cpp')
-rw-r--r--drape/vertex_array_buffer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp
index 1b2331da54..594f990a48 100644
--- a/drape/vertex_array_buffer.cpp
+++ b/drape/vertex_array_buffer.cpp
@@ -206,6 +206,11 @@ void VertexArrayBuffer::ApplyMutation(ref_ptr<IndexBufferMutator> indexMutator,
if (indexMutator != nullptr)
{
ASSERT(m_indexBuffer != nullptr, ());
+ if (indexMutator->GetCapacity() > m_indexBuffer->GetBuffer()->GetCapacity())
+ {
+ m_indexBuffer = make_unique_dp<IndexBuffer>(indexMutator->GetCapacity());
+ m_indexBuffer->MoveToGPU(GPUBuffer::IndexBuffer);
+ }
m_indexBuffer->UpdateData(indexMutator->GetIndexes(), indexMutator->GetIndexCount());
}