commit 4646b3cbae34571324c6ad39180f75117cb45b3d
parent 8a88c09b55fdafafb0efcc4495408c5889b7a782
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 13 Sep 2018 16:25:32 +0200
Check that the provided ray dir is normalized in svx_octree_trace_ray
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/svx_octree_trace_ray.c b/src/svx_octree_trace_ray.c
@@ -16,6 +16,8 @@
#include "svx.h"
#include "svx_tree.h"
+#include <rsys/double3.h>
+
struct ray {
/* Ray parameters in the normalized octree space [1, 2]^3 whose ray direction
* is assumed to be always negative. octant_mask defines which dimension was
@@ -389,7 +391,8 @@ svx_octree_trace_ray
struct ray ray;
res_T res = RES_OK;
- if(!oct || !org || !dir || !range || !hit || oct->type != SVX_OCTREE) {
+ if(!oct || !org || !dir || !range || !hit || oct->type != SVX_OCTREE
+ || !d3_is_normalized(dir)) {
res = RES_BAD_ARG;
goto error;
}