Fix T79754: Boundary Brush crashing with symmetry enabled

When creating the boundaries for the symmetry passess, it could happen
that a symmetrical vertex is not found inside the radius of the brush.
In that case, the function to initialize a new boundary was called with
index -1 (BOUNDARY_VERTEX_NONE), so this function should also check
that the initial vertex that is going to be used to find the boundary is
a valid index.

Reviewed By: sergey

Maniphest Tasks: T79754

Differential Revision: https://developer.blender.org/D8860
This commit is contained in:
Pablo Dobarro 2020-09-09 23:09:21 +02:00
parent 51befa4108
commit 4c3ad047e7
Notes: blender-bot 2023-02-14 08:35:51 +01:00
Referenced by issue #79754, Heap Buffer Overflow Using Boundary Brush
1 changed files with 4 additions and 0 deletions

View File

@ -501,6 +501,10 @@ SculptBoundary *SCULPT_boundary_data_init(Object *object,
{
SculptSession *ss = object->sculpt;
if (initial_vertex == BOUNDARY_VERTEX_NONE) {
return NULL;
}
SCULPT_vertex_random_access_ensure(ss);
SCULPT_boundary_info_ensure(object);