9 Jun
2023
9 Jun
'23
2:02 p.m.
Giovanni Mascellani (@giomasce) commented about libs/vkd3d/command.c:
return &array->ops[array->count++]; }
+static bool clone_tile_mapping_parameter(void **dst, const void *src, size_t elem_size, unsigned int count) +{ + void *buffer; + + *dst = NULL; + if (src) + { + if (!(buffer = vkd3d_malloc(count * elem_size)))
I would suggest `vkd3d_calloc()`, so that overflow is detected. As an aside, the method is not really specific for tile mappings, so it could get a more generic name. Like `clone_array()`. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/216#note_35267