d3dcompiler: Always initialize output shader blob pointer in D3DCompile2().

This commit is contained in:
Nikolay Sivov 2023-03-18 18:48:57 +01:00 committed by Alexandre Julliard
parent f50a263162
commit 472d802a24
2 changed files with 4 additions and 1 deletions

View file

@ -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;

View file

@ -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]);