mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-utils: Null-terminate the output of D3DPreprocess().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58596
This commit is contained in:
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
@@ -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;
|
||||
|
Reference in New Issue
Block a user