vkd3d-utils: Null-terminate the output of D3DPreprocess().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58596
This commit is contained in:
Elizabeth Figura
2025-08-15 18:50:17 -05:00
committed by Henri Verbeet
parent f52dc8a89a
commit 446b59319b
Notes: Henri Verbeet 2025-09-10 12:03:47 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1697
2 changed files with 8 additions and 5 deletions

View File

@@ -484,7 +484,10 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
if (!ret)
{
if (FAILED(hr = vkd3d_blob_create((void *)preprocessed_code.code, preprocessed_code.size, preprocessed_blob)))
/* vkd3d-shader output is null-terminated, but the null terminator isn't
* included in the size. Increase the size to account for that. */
if (FAILED(hr = vkd3d_blob_create((void *)preprocessed_code.code,
preprocessed_code.size + 1, preprocessed_blob)))
{
vkd3d_shader_free_shader_code(&preprocessed_code);
return hr;