diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 08:02:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 08:02:37 +0300 |
commit | 91f4a4d7e16643750c119e1c6684f63038d0be02 (patch) | |
tree | c4fbccd6f2d09aecb397a5d12e4be9b0357ae4e3 /source/blender/python/intern | |
parent | 8f6e5776207a473366bc2307226f329153819460 (diff) |
fix [#26323] Crash when adding to a vertex group with a raw in
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 8e7aba42a99..5e4291dff96 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -67,6 +67,10 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] if (dim + 1 < totdim) { /* check that a sequence contains dimsize[dim] items */ const int seq_size= PySequence_Size(seq); + if(seq_size == -1) { + PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not %s", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name); + return 0; + } for (i= 0; i < seq_size; i++) { PyObject *item; int ok= 1; @@ -100,6 +104,10 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] else { /* check that items are of correct type */ const int seq_size= PySequence_Size(seq); + if(seq_size == -1) { + PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not %s", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name); + return 0; + } for (i= 0; i < seq_size; i++) { PyObject *item= PySequence_GetItem(seq, i); |