From 7375b976880e160fbc4ecfdbbfa8d2ebd55e69cd Mon Sep 17 00:00:00 2001 From: Srekel Date: Fri, 8 Jan 2016 15:37:08 +0100 Subject: [PATCH] Fix for assert in VS2015 debug builds (and likely others too). ( Expression: vector subscript out of range ) --- 3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp b/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp index 0dd59c63..aa1f7935 100644 --- a/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp +++ b/3rdparty/forsyth-too/forsythtriangleorderoptimizer.cpp @@ -293,7 +293,7 @@ namespace Forsyth assert(vertexData.activeFaceListSize > 0); uint* begin = &activeFaceList[vertexData.activeFaceListStart]; - uint* end = &activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize]; + uint* end = &(activeFaceList[vertexData.activeFaceListStart + vertexData.activeFaceListSize - 1]) + 1; uint* it = std::find(begin, end, bestFace); assert(it != end); std::swap(*it, *(end-1));