Fix possible overflow

This commit is contained in:
Kim Kulling
2025-09-23 21:28:54 +02:00
parent fa18d3dde6
commit 30b20e07e7

View File

@@ -524,6 +524,9 @@ void XmlSerializer::ImportTriangles(XmlNode &node, aiMesh *mesh) {
auto update_color = [&](int idx) {
if (pindex[idx] != IdNotSet) {
size_t vertex_index = face.mIndices[idx];
if (vertex_index >= mesh->mNumVertices) {
return;
}
mesh->mColors[0][vertex_index] = group->mColors[pindex[idx]];
}
};