diff --git a/doc/changelog.dox b/doc/changelog.dox index 0893a1c7d..a0dc2998e 100644 --- a/doc/changelog.dox +++ b/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 diff --git a/src/Magnum/MeshTools/Tipsify.cpp b/src/Magnum/MeshTools/Tipsify.cpp index 43f7588cb..b3d437363 100644 --- a/src/Magnum/MeshTools/Tipsify.cpp +++ b/src/Magnum/MeshTools/Tipsify.cpp @@ -57,7 +57,9 @@ void tipsify(std::vector& indices, const UnsignedInt vertexCount, c std::vector 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;