mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:58:59 +02:00
Out-of-bounds check.
This commit is contained in:
parent
c08dfc90c3
commit
a1eeef3feb
1 changed files with 2 additions and 2 deletions
|
@ -715,7 +715,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int normalIndex = data.normalIndices.at(data.normalsByVertex ? vertexIndex : index);
|
int normalIndex = data.normalIndices.at(data.normalsByVertex ? vertexIndex : index);
|
||||||
if (normalIndex >= 0) {
|
if (normalIndex >= 0 && normalIndex < data.normals.size()) {
|
||||||
normal = data.normals.at(normalIndex);
|
normal = data.normals.at(normalIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int texCoordIndex = data.texCoordIndices.at(index);
|
int texCoordIndex = data.texCoordIndices.at(index);
|
||||||
if (texCoordIndex >= 0) {
|
if (texCoordIndex >= 0 && texCoordIndex < data.texCoords.size()) {
|
||||||
vertex.texCoord = data.texCoords.at(texCoordIndex);
|
vertex.texCoord = data.texCoords.at(texCoordIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue