diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-06-01 00:20:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-06-01 00:41:18 +0300 |
commit | d5b813301a81a7ec13996dfcb3a9bc88f56e4018 (patch) | |
tree | 81ac83b1a61544bf1a9e484eb09d83a9539dbdd1 | |
parent | 6f9518f2438ecca411cee85303f255cea853545b (diff) |
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
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 27956f1b808..17c680bbcde 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -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; } } } diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 6a91fcb8327..75d685fb9c6 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -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; } |