summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-03-01 14:41:44 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-01 20:20:36 +0000
commit738dc12da0a5b0fd9ddde597a93b04428a31a30f (patch)
treeebea225f7146340aa7d19b5fe5c5df59ea9ec838 /src
parent8b934a94087e13c4a6989bdf17a75e4c5c09718f (diff)
TrianglesVisitor: fix buffer overrun
The buffer was of size 3, but the loop statically indexed up to 5. Change-Id: Iee81366d8eab548ebaf61704e0bc71a3699617d5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/backend/trianglesvisitor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/render/backend/trianglesvisitor.cpp b/src/render/backend/trianglesvisitor.cpp
index 701b4a566..385a302ae 100644
--- a/src/render/backend/trianglesvisitor.cpp
+++ b/src/render/backend/trianglesvisitor.cpp
@@ -277,7 +277,7 @@ void traverseTriangleAdjacencyIndexed(index *indices,
while (i < indexInfo.count) {
for (uint u = 0; u < 6; u += 2) {
uint idx = indices[i + u] * verticesStride;
- ndx[u] = idx;
+ ndx[u / 2] = idx;
for (uint j = 0; j < maxVerticesDataSize; ++j) {
abc[u / 2][j] = vertices[idx + j];
}
@@ -303,7 +303,7 @@ void traverseTriangleAdjacency(Vertex *vertices,
while (i < vertexInfo.count) {
for (uint u = 0; u < 6; u += 2) {
uint idx = (i + u) * verticesStride;
- ndx[u] = idx;
+ ndx[u / 2] = idx;
for (uint j = 0; j < maxVerticesDataSize; ++j) {
abc[u / 2][j] = vertices[idx + j];
}