From 65cb05f38163ac36f5f5b263a4e29f0c25fcd148 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 2 Apr 2015 01:10:53 +0200 Subject: [PATCH] fix invalid index counter. Signed-off-by: Kim Kulling --- code/OpenGEXImporter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/OpenGEXImporter.cpp b/code/OpenGEXImporter.cpp index 40d90cfb1..322604415 100644 --- a/code/OpenGEXImporter.cpp +++ b/code/OpenGEXImporter.cpp @@ -655,10 +655,11 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene * for( size_t i = 0; i < numItems; i++ ) { aiFace *current( & ( m_currentMesh->mFaces[ i ] ) ); current->mNumIndices = 3; - current->mIndices = new unsigned int[ 3 ]; + current->mIndices = new unsigned int[ current->mNumIndices ]; Value *next( vaList->m_dataList ); - for( size_t i = 0; i < 3; i++ ) { - current->mIndices[ i ] = next->getInt32(); + for( size_t indices = 0; indices < current->mNumIndices; indices++ ) { + const int idx = next->getInt32(); + current->mIndices[ indices ] = next->getInt32(); next = next->m_next; } vaList = vaList->m_next;