mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: add bounds check for sweepscan indices
Only happens on extremely large and complex geometry.
This commit is contained in:
parent
248a652a15
commit
c9c687fc73
@ -1425,6 +1425,15 @@ bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
if (!previd)
|
||||
{
|
||||
previd = rid++;
|
||||
|
||||
// todo(amos): figure out why this happens on very complex and large
|
||||
// input geometry.
|
||||
if (previd >= nsweeps)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildLayerRegions: Sweep index out of bounds: previd (%d), nsweeps (%d).", previd, nsweeps);
|
||||
return false;
|
||||
}
|
||||
|
||||
sweeps[previd].rid = previd;
|
||||
sweeps[previd].ns = 0;
|
||||
sweeps[previd].nei = 0;
|
||||
@ -1734,6 +1743,15 @@ bool rcBuildLayerRegions(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
if (!previd)
|
||||
{
|
||||
previd = rid++;
|
||||
|
||||
// todo(amos): figure out why this happens on very complex and large
|
||||
// input geometry.
|
||||
if (previd >= nsweeps)
|
||||
{
|
||||
ctx->log(RC_LOG_ERROR, "rcBuildLayerRegions: Sweep index out of bounds: previd (%d), nsweeps (%d).", previd, nsweeps);
|
||||
return false;
|
||||
}
|
||||
|
||||
sweeps[previd].rid = previd;
|
||||
sweeps[previd].ns = 0;
|
||||
sweeps[previd].nei = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user