[Bf-blender-cvs] [21cb628] master: Assert for invalid customdata allocs

Campbell Barton noreply at git.blender.org
Tue Feb 25 13:13:49 CET 2014


Commit: 21cb6283995be9893c72b6c26e8b356e1189ce9c
Author: Campbell Barton
Date:   Tue Feb 25 23:13:17 2014 +1100
https://developer.blender.org/rB21cb6283995be9893c72b6c26e8b356e1189ce9c

Assert for invalid customdata allocs

===================================================================

M	source/blender/blenkernel/intern/customdata.c

===================================================================

diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index fffd115..a628504 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1649,6 +1649,8 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, int typ
 	           (alloctype == CD_DUPLICATE) ||
 	           (alloctype == CD_REFERENCE));
 
+	BLI_assert(size >= 0);
+
 	if (!typeInfo->defaultname && CustomData_has_layer(data, type))
 		return &data->layers[CustomData_get_layer_index(data, type)];




More information about the Bf-blender-cvs mailing list