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:
authorCampbell Barton <ideasman42@gmail.com>2013-07-10 09:38:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-10 09:38:36 +0400
commit06be19c0ec854966adffae404966c821b8ff94b3 (patch)
treeaada62246b0cf29e6230c0718d01a61977b46960 /source/blender/blenkernel/intern/customdata.c
parent974ec7ddcf1bc6a59d0192c84567cc0e03df1074 (diff)
add asserts for passing in bad index values to DM_get_***_data, CustomData_get()
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index b6c608661cd..83685477725 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2073,6 +2073,8 @@ void *CustomData_get(const CustomData *data, int index, int type)
int offset;
int layer_index;
+ BLI_assert(index >= 0);
+
/* get the layer index of the active layer of type */
layer_index = CustomData_get_active_layer_index(data, type);
if (layer_index < 0) return NULL;
@@ -2088,6 +2090,8 @@ void *CustomData_get_n(const CustomData *data, int type, int index, int n)
int layer_index;
int offset;
+ BLI_assert(index >= 0 && n >= 0);
+
/* get the layer index of the first layer of type */
layer_index = data->typemap[type];
if (layer_index < 0) return NULL;