Module: wine Branch: master Commit: 472d802a24eefe4a9c9f3a17592f50217c6e9966 URL: https://gitlab.winehq.org/wine/wine/-/commit/472d802a24eefe4a9c9f3a17592f502...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sat Mar 18 18:48:57 2023 +0100
d3dcompiler: Always initialize output shader blob pointer in D3DCompile2().
---
dlls/d3dcompiler_43/compiler.c | 2 ++ dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 8fb38cf592c..d3c7b81df12 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -462,6 +462,8 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen if (secondary_flags) FIXME("Ignoring secondary flags %#x.\n", secondary_flags);
+ if (shader_blob) + *shader_blob = NULL; if (messages_blob) *messages_blob = NULL;
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index a24cb9692e9..15af598c90d 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -1412,7 +1412,8 @@ static void test_fail(void) { for (i = 0; i < ARRAY_SIZE(tests); ++i) { - compiled = errors = NULL; + errors = NULL; + compiled = (void *)0xdeadbeef; hr = D3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors); ok(hr == E_FAIL, "Test %u, target %s: Got unexpected hr %#lx.\n", i, targets[j], hr); ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]);