diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-06 09:32:11 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-06 09:33:50 +0300 |
commit | 0484b6bb181635b1310275c1d176cbf076d98ce5 (patch) | |
tree | dc07b2c34cd57b01d9295babb1708acf4cb51b08 /source/blender | |
parent | 707c7de21f0bc9a1ca4e71ef4819dafada5542ac (diff) |
Fix T101591: mathutils.geometry.intersect_line_line 2D vector error
Uninitialized stack memory was used when intersecting 2D vectors.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/mathutils/mathutils_geometry.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index c8f9bfb0ed7..52ea2a9ed31 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -185,6 +185,13 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject return NULL; } + /* Zero 3rd axis of 2D vectors. */ + if (ix_vec_num == 2) { + lines[1][2] = 0.0f; + lines[2][2] = 0.0f; + lines[3][2] = 0.0f; + } + result = isect_line_line_v3(UNPACK4(lines), i1, i2); /* The return-code isn't exposed, * this way we can check know how close the lines are. */ |