Fix out of bounds write

pull/4699/head
Turo Lamminen 2022-08-23 14:38:27 +03:00
parent 68bc6a06b9
commit f890bc791f
1 changed files with 1 additions and 3 deletions

View File

@ -243,9 +243,7 @@ void SMDImporter::CreateOutputMeshes() {
// collect all faces
iNum = 0;
for (const auto &asTriangle : asTriangles) {
if (UINT_MAX == asTriangle.iTexture) {
aaiFaces[asTriangle.iTexture].push_back( 0 );
} else if (asTriangle.iTexture >= aszTextures.size()) {
if (asTriangle.iTexture >= aszTextures.size()) {
ASSIMP_LOG_INFO("[SMD/VTA] Material index overflow in face");
aaiFaces[asTriangle.iTexture].push_back((unsigned int)aszTextures.size()-1);
} else {