134062 Use after free
This commit is contained in:
@@ -168,6 +168,8 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// build output vertex weights
|
||||
for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
|
||||
{
|
||||
@@ -177,11 +179,11 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
|
||||
aiVertexWeight *weightToCopy = &( newWeights[i][0] );
|
||||
memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,
|
||||
sizeof(aiVertexWeight) * newWeights[i].size());
|
||||
delete[] newWeights;
|
||||
} else {
|
||||
pcMesh->mBones[i]->mWeights = NULL;
|
||||
}
|
||||
}
|
||||
delete[] newWeights;
|
||||
|
||||
// delete the old members
|
||||
delete[] pcMesh->mVertices;
|
||||
|
||||
4
test/unit/utCoverityTest.cpp
Normal file
4
test/unit/utCoverityTest.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
//
|
||||
// Created by wise on 9/24/16.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user