Assert for invalid customdata allocs

This commit is contained in:
Campbell Barton 2014-02-25 23:13:17 +11:00
parent ca2b4323a8
commit 21cb628399

@ -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)];