mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Use vector::at() when the index may not exist
To avoid invoking undefined behaviour.
This commit is contained in:
@@ -206,7 +206,9 @@ GetTransitiveAfterGroups(const std::vector<Group>& masterlistGroups,
|
||||
// Create a color map.
|
||||
std::vector<boost::default_color_type> colorVec(boost::num_vertices(graph));
|
||||
auto colorMap = boost::make_iterator_property_map(
|
||||
colorVec.begin(), boost::get(boost::vertex_index, graph), colorVec[0]);
|
||||
colorVec.begin(),
|
||||
boost::get(boost::vertex_index, graph),
|
||||
colorVec.at(0));
|
||||
|
||||
boost::depth_first_visit(graph, vertex, afterGroupsVisitor, colorMap);
|
||||
transitiveAfterGroups[graph[vertex]] = visitedGroups;
|
||||
|
||||
Reference in New Issue
Block a user