134062 Use after free

pull/1007/head
wise86Android 2016-09-24 12:33:53 +02:00
parent 96fab1cf55
commit 04e0552f9e
2 changed files with 7 additions and 1 deletions

View File

@ -168,6 +168,8 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
} }
} }
// build output vertex weights // build output vertex weights
for (unsigned int i = 0;i < pcMesh->mNumBones;++i) for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
{ {
@ -177,11 +179,11 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
aiVertexWeight *weightToCopy = &( newWeights[i][0] ); aiVertexWeight *weightToCopy = &( newWeights[i][0] );
memcpy(pcMesh->mBones[i]->mWeights, weightToCopy, memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,
sizeof(aiVertexWeight) * newWeights[i].size()); sizeof(aiVertexWeight) * newWeights[i].size());
delete[] newWeights;
} else { } else {
pcMesh->mBones[i]->mWeights = NULL; pcMesh->mBones[i]->mWeights = NULL;
} }
} }
delete[] newWeights;
// delete the old members // delete the old members
delete[] pcMesh->mVertices; delete[] pcMesh->mVertices;

View File

@ -0,0 +1,4 @@
//
// Created by wise on 9/24/16.
//