vkd3d-shader: Return NULL from vkd3d_shader_message_context_copy_messages() if there are no messages to copy.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-10-09 01:14:02 -05:00 committed by Alexandre Julliard
parent 0072fb213a
commit 05cf9a5404
2 changed files with 5 additions and 0 deletions

View File

@ -149,6 +149,9 @@ bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_cont
*out = NULL;
if (!context->messages.content_size)
return true;
if (!(messages = vkd3d_malloc(context->messages.content_size + 1)))
return false;
memcpy(messages, context->messages.buffer, context->messages.content_size + 1);

View File

@ -335,6 +335,8 @@ START_TEST(shader_runner_d3d12)
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
ok(!blob, "Expected no compiled shader blob.\n");
ok(!!errors, "Expected non-NULL error blob.\n");
if (!errors)
return;
if (vkd3d_test_state.debug_level)
trace("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));