From 865fd13b24be4a6aad9694c30c07e206797c2177 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 18 Mar 2023 11:46:57 +0900 Subject: [PATCH] recast4j - c3ffe19 - [Upstream] Fix for out of bounds read in tile cache builder --- src/DotRecast.Detour.TileCache/TileCacheBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs index c31a2c0..11de14b 100644 --- a/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs +++ b/src/DotRecast.Detour.TileCache/TileCacheBuilder.cs @@ -1492,7 +1492,7 @@ namespace DotRecast.Detour.TileCache } // Remove vertex. - for (int i = rem; i < mesh.nverts; ++i) + for (int i = rem; i < mesh.nverts - 1; ++i) { mesh.verts[i * 3 + 0] = mesh.verts[(i + 1) * 3 + 0]; mesh.verts[i * 3 + 1] = mesh.verts[(i + 1) * 3 + 1];