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
pull/5/head
aramis_acg 2012-02-05 16:10:50 +00:00
parent 58d0a89b25
commit 29d3a18962
1 changed files with 5 additions and 1 deletions

View File

@ -582,8 +582,12 @@ void MS3DImporter::InternReadFile( const std::string& pFile,
if(joints.size()) { if(joints.size()) {
#ifndef ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH #ifndef ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
rt->mChildren = new aiNode*[1](); 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(); aiNode* jt = rt->mChildren[pScene->mNumMeshes] = new aiNode();
#endif
jt->mParent = rt; jt->mParent = rt;
CollectChildJoints(joints,jt); CollectChildJoints(joints,jt);
jt->mName.Set("<MS3DJointRoot>"); jt->mName.Set("<MS3DJointRoot>");