Skip to content

Commit

Permalink
Bugfix: SparseTable index segfaulted when non-existing node was queried.
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Apr 28, 2015
1 parent 6b9fa0f commit 7f23002
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/osmium/storage/byid/fixed_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace Osmium {
* There is no range checking on accessing the store.
*
* If you are storing node coordinates, you'll need 8 bytes for each node.
* At the time of writing this, the largest node ID is about 1.3 billion,
* so you'll need about 10 GB of memory.
* At the time of writing this, the largest node ID is over 3 billion,
* so you'll need over 24 GB of memory.
*
* Note that this storage class will only work on 64 bit systems if
* used for storing node coordinates. 32 bit systems just can't address
Expand Down
3 changes: 3 additions & 0 deletions include/osmium/storage/byid/sparse_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ namespace Osmium {
}

const TValue operator[](const uint64_t id) const {
if (id >= m_items.size()) {
return TValue();
}
return m_items[id];
}

Expand Down

0 comments on commit 7f23002

Please sign in to comment.