Fix crash entering editmode

This commit is contained in:
Campbell Barton 2018-11-28 20:26:07 +11:00
parent 78a6c2e12c
commit ff0a29df14
1 changed files with 4 additions and 2 deletions

View File

@ -75,8 +75,10 @@ Base **BKE_view_layer_array_from_bases_in_mode_params(
BLI_array_append(base_array, base_iter);
} FOREACH_BASE_IN_MODE_END;
if (base_array != NULL) {
base_array = MEM_reallocN(base_array, sizeof(*base_array) * BLI_array_len(base_array));
base_array = MEM_reallocN(base_array, sizeof(*base_array) * BLI_array_len(base_array));
/* We always need a valid allocation (prevent crash on free). */
if (base_array == NULL) {
base_array = MEM_mallocN(0, __func__);
}
*r_len = BLI_array_len(base_array);
return base_array;