mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix: Remove invalid MEM_allocN_len from CustomData debug info
The layer data is not guaranteed to be allocated by Blender's own allocator. Fundamentally CustomData does not really know the size of the data layer arrays.
This commit is contained in:
parent
8fed7750d2
commit
6ff59d28e4
1 changed files with 8 additions and 11 deletions
|
|
@ -5019,20 +5019,17 @@ void CustomData_debug_info_from_layers(const CustomData *data, const char *inden
|
|||
const char *name = CustomData_layertype_name(type);
|
||||
const int size = CustomData_sizeof(type);
|
||||
const void *pt = CustomData_get_layer(data, type);
|
||||
const int pt_size = pt ? int(MEM_allocN_len(pt) / size) : 0;
|
||||
const char *structname;
|
||||
int structnum;
|
||||
get_type_file_write_info(type, &structname, &structnum);
|
||||
BLI_dynstr_appendf(
|
||||
dynstr,
|
||||
"%sdict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n",
|
||||
indent,
|
||||
name,
|
||||
structname,
|
||||
type,
|
||||
pt,
|
||||
size,
|
||||
pt_size);
|
||||
BLI_dynstr_appendf(dynstr,
|
||||
"%sdict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d),\n",
|
||||
indent,
|
||||
name,
|
||||
structname,
|
||||
type,
|
||||
pt,
|
||||
size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue