Catch potential division by zero.

This commit is contained in:
Marcus Edel
2021-04-12 03:48:53 +02:00
parent 270dec8fb4
commit 044c2a4fbd
@@ -435,7 +435,8 @@ bool XTreeSplit::SplitNonLeafNode(TreeType *tree, std::vector<bool>& relevels)
bool useMinOverlapSplit = false;
if (tiedOnOverlap)
{
if (overlapBestAreaAxis / areaBestAreaAxis < MAX_OVERLAP)
if (MAX_OVERLAP > 0 &&
overlapBestAreaAxis / areaBestAreaAxis < MAX_OVERLAP)
{
tree->numDescendants = 0;
tree->bound.Clear();