Ticket #4631: debian-changes-1.42.0-4.1

File debian-changes-1.42.0-4.1, 1.3 KB (added by Esben Mose Hansen <esben@…>, 12 years ago)

Fix for above crash

Line 
1Fix crash in r_c_shortest_paths when no paths were found and only one were asked for.
2Author: Esben Mose Hansen <esben@ange.dk>
3--- boost1.42-1.42.0.orig/boost/graph/r_c_shortest_paths.hpp
4+++ boost1.42-1.42.0/boost/graph/r_c_shortest_paths.hpp
5@@ -559,8 +559,10 @@ void r_c_shortest_paths
6 dominance,
7 la,
8 vis );
9- pareto_optimal_solution = pareto_optimal_solutions[0];
10- pareto_optimal_resource_container = pareto_optimal_resource_containers[0];
11+ if (!pareto_optimal_solutions.empty()) {
12+ pareto_optimal_solution = pareto_optimal_solutions[0];
13+ pareto_optimal_resource_container = pareto_optimal_resource_containers[0];
14+ }
15 }
16
17 // third overload:
18@@ -644,8 +646,10 @@ void r_c_shortest_paths
19 dominance,
20 default_r_c_shortest_paths_allocator(),
21 default_r_c_shortest_paths_visitor() );
22- pareto_optimal_solution = pareto_optimal_solutions[0];
23- pareto_optimal_resource_container = pareto_optimal_resource_containers[0];
24+ if (!pareto_optimal_solutions.empty()) {
25+ pareto_optimal_solution = pareto_optimal_solutions[0];
26+ pareto_optimal_resource_container = pareto_optimal_resource_containers[0];
27+ }
28 }
29 // r_c_shortest_paths
30