commit 034371c6de126ed6e76fbcb8bd9846ee2df2b7d1
parent 07488f244209e046bd3825535980cf2fe2f75bb9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 12 Oct 2020 11:08:26 +0200
Add assertions on tetrahedron indices in build_bvh
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/suvm_volume.c b/src/suvm_volume.c
@@ -350,6 +350,11 @@ build_bvh(struct suvm_volume* vol)
struct RTCBuildPrimitive* prim = darray_rtc_prim_data_get(&rtc_prims)+iprim;
double low[3], upp[3];
+ ASSERT(ids[0] < volume_get_vertices_count(vol));
+ ASSERT(ids[1] < volume_get_vertices_count(vol));
+ ASSERT(ids[2] < volume_get_vertices_count(vol));
+ ASSERT(ids[3] < volume_get_vertices_count(vol));
+
/* Fetch the tetrahedron vertices */
verts[0] = darray_float_cdata_get(&vol->positions) + ids[0]*3/*#coords*/;
verts[1] = darray_float_cdata_get(&vol->positions) + ids[1]*3/*#coords*/;