mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +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 {
|
||||
int normalIndex = data.normalIndices.at(data.normalsByVertex ? vertexIndex : index);
|
||||
if (normalIndex >= 0) {
|
||||
if (normalIndex >= 0 && normalIndex < data.normals.size()) {
|
||||
normal = data.normals.at(normalIndex);
|
||||
}
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index) {
|
|||
}
|
||||
} else {
|
||||
int texCoordIndex = data.texCoordIndices.at(index);
|
||||
if (texCoordIndex >= 0) {
|
||||
if (texCoordIndex >= 0 && texCoordIndex < data.texCoords.size()) {
|
||||
vertex.texCoord = data.texCoords.at(texCoordIndex);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue