Fix crash in MLD alternative search if source or target are invalid (#5851)

In situations where there is not a valid source or target phantom
node (e.g. when snapping to an edge with a zero weight), a
heap assertion will fail in the MLD alternative search code.

We fix this by checking for empty heaps before proceeding with
the search.
This commit is contained in:
Michael Bell
2020-10-08 23:27:02 +01:00
committed by GitHub
parent e033e0b553
commit f87a324633
3 changed files with 30 additions and 0 deletions
@@ -663,6 +663,10 @@ makeCandidateVias(SearchEngineData<Algorithm> &search_engine_data,
Heap &reverse_heap = *search_engine_data.reverse_heap_1;
insertNodesInHeaps(forward_heap, reverse_heap, phantom_node_pair);
if (forward_heap.Empty() || reverse_heap.Empty())
{
return {};
}
// The single via node in the shortest paths s,via and via,t sub-paths and
// the weight for the shortest path s,t we return and compare alternatives to.