From 29d3a1896288eb11a79e4452b18e329dc7d1dc90 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 5 Feb 2012 16:10:50 +0000 Subject: [PATCH] Fix [3211530] heap corruption in the ms3d importer. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1163 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/MS3DLoader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/MS3DLoader.cpp b/code/MS3DLoader.cpp index 747c5bd0f..c3964ca46 100644 --- a/code/MS3DLoader.cpp +++ b/code/MS3DLoader.cpp @@ -582,8 +582,12 @@ void MS3DImporter::InternReadFile( const std::string& pFile, if(joints.size()) { #ifndef ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH rt->mChildren = new aiNode*[1](); -#endif + rt->mNumChildren = 1; + + aiNode* jt = rt->mChildren[0] = new aiNode(); +#else aiNode* jt = rt->mChildren[pScene->mNumMeshes] = new aiNode(); +#endif jt->mParent = rt; CollectChildJoints(joints,jt); jt->mName.Set("");