diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-01 12:57:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-01 12:59:26 +0300 |
commit | 1140238acf31fba54e3a88b9519c8e8b46b19d59 (patch) | |
tree | 1ca4229cd6884af83a639d8b88e0d3ec2bba7961 | |
parent | 55f87590f09d6ab960d4f64d8d7c0503bc5b6b06 (diff) |
Fix T45976: Crash accessing BMesh customdata
Layers returned from items() and values() could have an invalid index.
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_customdata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 3adf37f78f0..5addc4ce16b 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -490,7 +490,7 @@ static PyObject *bpy_bmlayercollection_items(BPy_BMLayerCollection *self) item = PyTuple_New(2); PyTuple_SET_ITEMS(item, PyUnicode_FromString(data->layers[index].name), - BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index)); + BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, i)); PyList_SET_ITEM(ret, i++, item); } @@ -523,7 +523,7 @@ static PyObject *bpy_bmlayercollection_values(BPy_BMLayerCollection *self) ret = PyList_New(tot); for (i = 0; tot-- > 0; index++) { - item = BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, index); + item = BPy_BMLayerItem_CreatePyObject(self->bm, self->htype, self->type, i); PyList_SET_ITEM(ret, i++, item); } |