Debian Codegraph @

debian/patches/0002-Bounds-checks-were-unnecessary-inclusive.-418.patch

raw
1 From 603dc88e5d7fb0b1c273cff14bbdbf01506b7700 Mon Sep 17 00:00:00 2001
2 From: Anton Matveev <[email protected]>
3 Date: Mon, 3 Jul 2023 05:42:37 +0500
4 Subject: [PATCH 02/36] Bounds checks were unnecessary inclusive. (#418)
5
6 Co-authored-by: Graham Pentheny <[email protected]>
7 ---
8 Recast/Source/RecastArea.cpp | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-)
10
11 diff --git a/Recast/Source/RecastArea.cpp b/Recast/Source/RecastArea.cpp
12 index 07fb021..45406dc 100644
13 --- a/Recast/Source/RecastArea.cpp
14 +++ b/Recast/Source/RecastArea.cpp
15 @@ -493,7 +493,7 @@ int rcOffsetPoly(const float* verts, const int nverts, const float offset,
16
17 if (bevel && cross < 0.0f)
18 {
19 - if (n+2 >= maxOutVerts)
20 + if (n+2 > maxOutVerts)
21 return 0;
22 float d = (1.0f - (dx0*dx1 + dy0*dy1))*0.5f;
23 outVerts[n*3+0] = vb[0] + (-dlx0+dx0*d)*offset;
24 @@ -507,7 +507,7 @@ int rcOffsetPoly(const float* verts, const int nverts, const float offset,
25 }
26 else
27 {
28 - if (n+1 >= maxOutVerts)
29 + if (n+1 > maxOutVerts)
30 return 0;
31 outVerts[n*3+0] = vb[0] - dmx*offset;
32 outVerts[n*3+1] = vb[1];
33 --
34 2.43.0
35