浏览代码

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
aramis_acg 13 年之前
父节点
当前提交
29d3a18962
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      code/MS3DLoader.cpp

+ 5 - 1
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("<MS3DJointRoot>");