summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-05-17 21:26:47 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-05-17 21:26:47 -0700
commit6bb650c8062b76770624073f779dcf433028fddd (patch)
treed0859c354bb001fa13e992c592bb34eaa0092037
parenteab950c0678b44912daad5e716d0f0762c7a0894 (diff)
libix2: fix bug in OOB insert
Was returning the user-supplied object pointer as the ix2_object_t, oops.
-rw-r--r--src/ix2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ix2.c b/src/ix2.c
index 28c4c11..04513e1 100644
--- a/src/ix2.c
+++ b/src/ix2.c
@@ -426,7 +426,7 @@ ix2_object_t * ix2_insert_object(ix2_t *ix2, aabb_t *object_aabb, void *object)
o->aabb_len_sq = aabb_len_sq(object_aabb);
if (!aabb_overlap(&ix2->aabb, object_aabb))
- return object;
+ return o;
return add_object(ix2, &depth, &ix2->root, &ix2->aabb, o, NULL);
}
© All Rights Reserved