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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user