Browse Source

MeshTools: fix obvious out-of-range access in tipsify().

Spotted by MSVC compiler (which does range check on everything). This
was probably harmless, as the out-of-range memory wasn't accessed
afterwards (the for cycle would end right after that because vi == 3),
but it was firing the assertion so it's better to have it fixed.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
5373fdf3ad
  1. 4
      src/Magnum/MeshTools/Tipsify.cpp

4
src/Magnum/MeshTools/Tipsify.cpp

@ -61,7 +61,9 @@ void Tipsify::operator()(std::size_t cacheSize) {
emitted[t] = true;
/* Write all vertices of the triangle to output buffer */
for(UnsignedInt vi = 0, v = indices[t*3]; vi != 3; v = indices[++vi+t*3]) {
for(UnsignedInt vi = 0; vi != 3; ++vi) {
const UnsignedInt v = indices[vi + t*3];
outputIndices.push_back(v);
/* Add to dead end stack and candidates array */

Loading…
Cancel
Save