8 Aug
2023
8 Aug
'23
1:50 p.m.
```diff +static enum vkd3d_result convert_descriptor_info(struct vkd3d_shader_scan_descriptor_info *info, + const struct vkd3d_shader_scan_descriptor_info1 *info1) +{ + unsigned int i; + + if (!(info->descriptors = vkd3d_malloc(info1->descriptor_count * sizeof(*info->descriptors)))) + return VKD3D_ERROR_OUT_OF_MEMORY; ```
The vkd3d_malloc() call is safe because sizeof(*info->descriptors) <= sizeof(*info1->descriptors), but I don't think it's setting a great example; we'd generally want to use vkd3d_calloc(). -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/295#note_41679