Fix rare PointsChirality infinite loop
Under some inputs, MatrixUtils.PointsChirality could enter into an infinite loop consuming memory until an OOM occurs. This was due to the FloodFill-based operation endlessly propagate zero values. This adds a defensive check to prevent propagating zero values.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
3177de7b2c
commit
fd5e05ca6b
@@ -1078,7 +1078,7 @@ namespace OpenRA.Mods.Common.MapGenerator
|
||||
if (prop == FirstPassSentinel)
|
||||
return chirality[point];
|
||||
|
||||
if (chirality[point] != 0)
|
||||
if (chirality[point] != 0 || prop == 0)
|
||||
return null;
|
||||
chirality[point] = prop;
|
||||
return prop;
|
||||
|
||||
Reference in New Issue
Block a user