Browse Source

MeshTools: fix an OOB access in tipsify().

pull/415/head
Vladimír Vondruš 6 years ago
parent
commit
7cbd7c703b
  1. 2
      doc/changelog.dox
  2. 4
      src/Magnum/MeshTools/Tipsify.cpp

2
doc/changelog.dox

@ -188,6 +188,8 @@ See also:
- Calling @ref Platform::Sdl2Application::setSwapInterval() with @cpp 0 @ce
caused @ref Platform::Sdl2Application::setMinimalLoopPeriod() "setMinimalLoopPeriod()"
to be ignored even though Vsync was in fact not enabled.
- Fixed an otherwise harmless OOB access in @ref MeshTools::tipsify() that
could trigger ASan or debug iterator errors
@subsection changelog-latest-deprecated Deprecated APIs

4
src/Magnum/MeshTools/Tipsify.cpp

@ -57,7 +57,9 @@ void tipsify(std::vector<UnsignedInt>& indices, const UnsignedInt vertexCount, c
std::vector<UnsignedInt> candidates;
/* For all neighbors of fanning vertex */
for(UnsignedInt ti = neighborOffset[fanningVertex], t = neighbors[ti]; ti != neighborOffset[fanningVertex+1]; t = neighbors[++ti]) {
for(UnsignedInt ti = neighborOffset[fanningVertex]; ti != neighborOffset[fanningVertex+1]; ++ti) {
const UnsignedInt t = neighbors[ti];
/* Continue if already emitted */
if(emitted[t]) continue;
emitted[t] = true;

Loading…
Cancel
Save