diff --git a/src/thirdparty/recast/Recast/Source/Recast.cpp b/src/thirdparty/recast/Recast/Source/Recast.cpp index 4c0d551e..3c74eefb 100644 --- a/src/thirdparty/recast/Recast/Source/Recast.cpp +++ b/src/thirdparty/recast/Recast/Source/Recast.cpp @@ -405,6 +405,9 @@ bool rcBuildCompactHeightfield(rcContext* context, const int walkableHeight, con const int ySize = heightfield.height; const int spanCount = rcGetHeightFieldSpanCount(context, heightfield); + if (!spanCount) + return false; + // Fill in header. compactHeightfield.width = xSize; compactHeightfield.height = ySize;