Module: vkd3d Branch: master Commit: d0f8443ac52c9e91029490c7425450f46e1f3067 URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=d0f8443ac52c9e91029490c7...
Author: Józef Kucia jkucia@codeweavers.com Date: Thu Mar 7 11:01:14 2019 +0100
vkd3d: Do not crash on NULL views in IASetIndexBuffers().
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
libs/vkd3d/command.c | 6 ++++++ tests/d3d12.c | 1 + 2 files changed, 7 insertions(+)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index e535f20..9ed768d 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3583,6 +3583,12 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12Graphics
TRACE("iface %p, view %p.\n", iface, view);
+ if (!view) + { + WARN("Ignoring NULL index buffer view.\n"); + return; + } + vk_procs = &list->device->vk_procs;
switch (view->Format) diff --git a/tests/d3d12.c b/tests/d3d12.c index 5f869d2..173c576 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -4492,6 +4492,7 @@ static void test_draw_indexed_instanced(void) ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state); ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + ID3D12GraphicsCommandList_IASetIndexBuffer(command_list, NULL); ID3D12GraphicsCommandList_IASetIndexBuffer(command_list, &ibv); ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);