From 6bb650c8062b76770624073f779dcf433028fddd Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 17 May 2018 21:26:47 -0700 Subject: libix2: fix bug in OOB insert Was returning the user-supplied object pointer as the ix2_object_t, oops. --- src/ix2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3