+ An error occurs when it is 0 (#6544)

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
copycd
2026-03-17 08:33:49 +09:00
committed by GitHub
parent b5f567bd3a
commit fcb1702162

View File

@@ -766,9 +766,12 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
ASSIMP_LOG_WARN("The number of vertices was not compatible with the TRIANGLES mode. Some vertices were dropped.");
count = nFaces * 3;
}
facePtr = faces = new aiFace[nFaces];
for (unsigned int i = 0; i < count; i += 3) {
SetFaceAndAdvance3(facePtr, aim->mNumVertices, indexBuffer[i], indexBuffer[i + 1], indexBuffer[i + 2]);
// copycd:: than > 0
if (nFaces > 0) {
facePtr = faces = new aiFace[nFaces];
for (unsigned int i = 0; i < count; i += 3) {
SetFaceAndAdvance3(facePtr, aim->mNumVertices, indexBuffer[i], indexBuffer[i + 1], indexBuffer[i + 2]);
}
}
break;
}