CustomData: add assert to prevent negative array access

This commit is contained in:
Campbell Barton
2020-09-15 13:17:19 +10:00
parent e51ff29919
commit e86785c514

View File

@@ -2350,6 +2350,7 @@ int CustomData_get_layer_index(const CustomData *data, int type)
int CustomData_get_layer_index_n(const struct CustomData *data, int type, int n)
{
BLI_assert(n >= 0);
int i = CustomData_get_layer_index(data, type);
if (i != -1) {