Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r--source/blender/python/intern/bpy_rna.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index dff96f74d62..ec2e70ad262 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2825,9 +2825,11 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
const Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
if (start < 0) {
start += len;
+ CLAMP_MIN(start, 0);
}
if (stop < 0) {
stop += len;
+ CLAMP_MIN(stop, 0);
}
}
@@ -2955,9 +2957,11 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self,
Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
if (start < 0) {
start += len;
+ CLAMP_MIN(start, 0);
}
if (stop < 0) {
stop += len;
+ CLAMP_MIN(stop, 0);
}
}