mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix heap buffer overflow during link remap [ASAN]
Polyrefs may become invalid as we remove dead polygons and reindex the remainders. If the polyref is invalid, skip the link as it will be thrown out anyways. Issue was found using address sanitizer on level mp_rr_desertlands_64k_x_64k.
This commit is contained in:
parent
9b44b098f8
commit
d5116913d6
@ -1647,6 +1647,9 @@ bool dtUpdateNavMeshData(dtNavMesh* nav, const unsigned int tileIndex)
|
||||
if (it != tileIndex)
|
||||
continue;
|
||||
|
||||
if (salt != tile->salt || ip >= (unsigned int)header->polyCount)
|
||||
continue;
|
||||
|
||||
const dtPolyRef newRef = (polyRefBase | (dtPolyRef)newPolyIdMap[ip]);
|
||||
neiLink.ref = newRef;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user