ASE: Fix possible out of bound access. (#6045)

This commit is contained in:
Kim Kulling
2025-03-12 21:12:02 +01:00
committed by GitHub
parent c1eedbba8e
commit 7c705fde41

View File

@@ -731,6 +731,10 @@ void ASEImporter::BuildUniqueRepresentation(ASE::Mesh &mesh) {
unsigned int iCurrent = 0, fi = 0;
for (std::vector<ASE::Face>::iterator i = mesh.mFaces.begin(); i != mesh.mFaces.end(); ++i, ++fi) {
for (unsigned int n = 0; n < 3; ++n, ++iCurrent) {
const uint32_t curIndex = (*i).mIndices[n];
if (curIndex >= mesh.mPositions.size()) {
throw DeadlyImportError("ASE: Invalid vertex index in face ", fi, ".");
}
mPositions[iCurrent] = mesh.mPositions[(*i).mIndices[n]];
// add texture coordinates