diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 13:03:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 13:03:28 +0400 |
commit | dc591a633e73452f0a22d00c23b29453f7c04724 (patch) | |
tree | 92368c6a167ed46262bd3c6ce1c81d3ae012f3c4 /source/blender/editors/mesh/mesh_data.c | |
parent | 02ba328ca8a4f606deaed531274b93ed7aa8ea6f (diff) |
previous commit r58256, had error in editmode (somehow it worked in most tests still).
also don't decrement active indices below zero (also a problem in 2.67).
Diffstat (limited to 'source/blender/editors/mesh/mesh_data.c')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 78f13dd3556..b825de58678 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -127,16 +127,18 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) { const int type = layer->type; CustomData *data; - int layer_index, tot; + int layer_index, tot, n; data = mesh_customdata_get_type(me, (ELEM(type, CD_MLOOPUV, CD_MLOOPCOL)) ? BM_LOOP : BM_FACE, &tot); layer_index = CustomData_get_layer_index(data, type); + n = (layer - &data->layers[layer_index]); + BLI_assert(n >= 0 && (n + layer_index) < data->totlayer); if (me->edit_btmesh) { - BM_data_layer_free_n(me->edit_btmesh->bm, data, type, layer_index + (layer - &data->layers[layer_index])); + BM_data_layer_free_n(me->edit_btmesh->bm, data, type, n); } else { - CustomData_free_layer(data, type, tot, (layer - &data->layers[layer_index])); + CustomData_free_layer(data, type, tot, n); BKE_mesh_update_customdata_pointers(me, true); } } |