From dc553d52d82380ab0c99bb0fa97ae5c1f11ab2be Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 28 Oct 2016 00:41:15 -0700 Subject: [PATCH] Fix over-sized allocation of rtree leaf nodes. Use the correct level metadata when allocating child nodes so that leaf nodes don't end up over-sized (2^16 elements vs 2^4 elements). --- src/rtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtree.c b/src/rtree.c index 5590034b..f2e2997d 100644 --- a/src/rtree.c +++ b/src/rtree.c @@ -128,5 +128,5 @@ rtree_node_elm_t * rtree_child_read_hard(rtree_t *rtree, rtree_node_elm_t *elm, unsigned level) { - return (rtree_node_init(rtree, level, &elm->child)); + return (rtree_node_init(rtree, level+1, &elm->child)); }