Fix T65330: Blender crash when double click on face

The fix itself is by Germano Cavalcante (mano-wii).

But since I was investigating this with him, I'm including here an
assert in EDBM_select_id_bm_elem_get to help catching this sooner
in the future
This commit is contained in:
Dalai Felinto 2019-05-31 18:20:47 -03:00
parent 6f9518f243
commit d5b813301a
Notes: blender-bot 2023-02-14 02:22:11 +01:00
Referenced by issue #65377, Crash when clicking on face in edit mode
Referenced by issue #65330, Blender crash when double click on face with subsurf modifier
2 changed files with 6 additions and 1 deletions

View File

@ -2757,7 +2757,7 @@ static void mesh_create_edit_facedots_select_id(MeshRenderData *rdata, GPUVertBu
if (p_orig != ORIGINDEX_NONE) {
const BMFace *efa = BM_face_at_index(rdata->edit_bmesh->bm, p_orig);
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
*((uint *)GPU_vertbuf_raw_step(&idx_step)) = poly;
*((uint *)GPU_vertbuf_raw_step(&idx_step)) = p_orig;
}
}
}

View File

@ -302,6 +302,11 @@ BMElem *EDBM_select_id_bm_elem_get(struct EDBMSelectID_Context *sel_id_ctx,
}
}
if (base_index >= sel_id_ctx->bases_len) {
BLI_assert(0);
return NULL;
}
if (r_base_index) {
*r_base_index = base_index;
}