Fix out of bound access
parent
625528d02c
commit
614911bb3b
|
@ -564,6 +564,10 @@ void PLYImporter::LoadFace(const PLY::Element *pcElement, const PLY::ElementInst
|
||||||
if (mGeneratedMesh->mFaces == nullptr) {
|
if (mGeneratedMesh->mFaces == nullptr) {
|
||||||
mGeneratedMesh->mNumFaces = pcElement->NumOccur;
|
mGeneratedMesh->mNumFaces = pcElement->NumOccur;
|
||||||
mGeneratedMesh->mFaces = new aiFace[mGeneratedMesh->mNumFaces];
|
mGeneratedMesh->mFaces = new aiFace[mGeneratedMesh->mNumFaces];
|
||||||
|
} else {
|
||||||
|
if (mGeneratedMesh->mNumFaces < pcElement->NumOccur) {
|
||||||
|
throw DeadlyImportError("Invalid .ply file: Too many faces");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bIsTriStrip) {
|
if (!bIsTriStrip) {
|
||||||
|
|
Loading…
Reference in New Issue