diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-09 11:02:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-09 11:02:51 +0400 |
commit | 6f8c29ab0b0b33bcb8fc75d47fc3f5eca8fc55cd (patch) | |
tree | 05f75e99305421b82a209d8ff2f55bff50bacdc1 /source | |
parent | 279a2a1916d87aea05a67a592c9831c8d335071b (diff) |
fix for 2 errors introduced since release
- shape key NULL pointer dereference.
- use uninitialized variable for bmesh free.
also update credits and merge dissolve flag assignment.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 9 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_dissolve.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 6 |
4 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index f3da337f653..6502346d88a 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -168,9 +168,8 @@ void BM_mesh_data_free(BMesh *bm) BMIter iter; BMIter itersub; - bool is_ldata_free; - bool is_pdata_free; - + const bool is_ldata_free = CustomData_bmesh_has_free(&bm->ldata); + const bool is_pdata_free = CustomData_bmesh_has_free(&bm->pdata); /* Check if we have to call free, if not we can avoid a lot of looping */ if (CustomData_bmesh_has_free(&(bm->vdata))) { @@ -184,9 +183,7 @@ void BM_mesh_data_free(BMesh *bm) } } - if ((is_ldata_free = CustomData_bmesh_has_free(&(bm->ldata))) || - (is_pdata_free = CustomData_bmesh_has_free(&(bm->pdata)))) - { + if (is_ldata_free || is_pdata_free) { BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if (is_pdata_free) CustomData_bmesh_free_block(&(bm->pdata), &(f->head.data)); diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index edac72423b4..ee483edbef5 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -403,8 +403,7 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) } BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) { - BMO_elem_flag_enable(bm, f, FACE_ORIG); - BMO_elem_flag_enable(bm, f, FACE_MARK); + BMO_elem_flag_enable(bm, f, FACE_MARK | FACE_ORIG); } /* check if our additions to the input to face dissolve @@ -412,8 +411,7 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) if (!test_extra_verts(bm, v)) { BM_ITER_ELEM (f, &fiter, v, BM_FACES_OF_VERT) { if (BMO_elem_flag_test(bm, f, FACE_ORIG)) { - BMO_elem_flag_disable(bm, f, FACE_MARK); - BMO_elem_flag_disable(bm, f, FACE_ORIG); + BMO_elem_flag_disable(bm, f, FACE_MARK | FACE_ORIG); } } } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 617e366a924..a5dc0e9cd41 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -145,7 +145,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) /* derivedMesh might be needed for solving parenting, * so re-create it here */ - makeDerivedMesh(scene, obedit, em, CD_MASK_BAREMESH|CD_MASK_ORIGINDEX, 0); + makeDerivedMesh(scene, obedit, em, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX, 0); BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) { diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 6fd2054637d..543b003f5a5 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -458,10 +458,10 @@ static int shape_key_move_exec(bContext *C, wmOperator *op) } SWAP(float, kb_other->pos, kb->pos); /* for absolute shape keys */ - } - /* First key is refkey, matches interface and BKE_key_sort */ - key->refkey = key->block.first; + /* First key is refkey, matches interface and BKE_key_sort */ + key->refkey = key->block.first; + } DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); |