Fix T101591: mathutils.geometry.intersect_line_line 2D vector error
Uninitialized stack memory was used when intersecting 2D vectors.
This commit is contained in:
parent
707c7de21f
commit
0484b6bb18
Notes:
blender-bot
2023-02-14 11:21:43 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93 Referenced by issue #88449, Blender LTS: Maintenance Task 2.93 Referenced by issue #100749, Blender LTS: Maintenance Task 3.3 Referenced by issue #101591, mathutils.geometry.intersect_line_line does not behave consistently for 2D vectors on Linux
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue