Skip to content

Commit 5a644be

Browse files
committed
Avoid reading from empty sparseBlock
Fixes #1442
1 parent bfc3fa3 commit 5a644be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node-ram-cache.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ void node_ram_cache::set_dense(osmid_t id, osmium::Location location)
263263

264264
osmium::Location node_ram_cache::get_sparse(osmid_t id) const
265265
{
266+
if (sizeSparseTuples == 0) {
267+
return osmium::Location{};
268+
}
269+
266270
int64_t pivotPos = sizeSparseTuples >> 1;
267271
int64_t minPos = 0;
268272
int64_t maxPos = sizeSparseTuples;

0 commit comments

Comments
 (0)