Fix uninitialized variable use w/ kdopbvh ray projection
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Jan 2019 04:00:32 +0000 (15:00 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Jan 2019 04:02:58 +0000 (15:02 +1100)
Snapping verts for eg would use these values uninitialized.

source/blender/blenlib/intern/math_geom.c

index d9f4183d8abc9376cee9567b295bbf6880dc7420..bd1e3d0a12b07d1d282ce6d8edd0e7f9ac5af4f0 100644 (file)
@@ -860,6 +860,10 @@ float dist_squared_to_projected_aabb(
        float rtmin, rtmax;
        int main_axis;
 
+       r_axis_closest[0] = false;
+       r_axis_closest[1] = false;
+       r_axis_closest[2] = false;
+
        if ((tmax[0] <= tmax[1]) && (tmax[0] <= tmax[2])) {
                rtmax = tmax[0];
                va[0] = vb[0] = local_bvmax[0];