Marvel's Avengers randomly hits this case.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/d3d11/device.c | 9 +++++++++ dlls/d3d11/tests/d3d11.c | 5 +++++ 2 files changed, 14 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 0508fa3f7b2..2a68e025852 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -965,6 +965,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, src_resource, src_subresource_idx, src_box);
+ if (!dst_resource || !src_resource) + return; + if (src_box) wined3d_box_set(&wined3d_src_box, src_box->left, src_box->top, src_box->right, src_box->bottom, src_box->front, src_box->back); @@ -2438,6 +2441,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion1(ID3 iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, src_resource, src_subresource_idx, src_box, flags);
+ if (!dst_resource || !src_resource) + return; + if (src_box) wined3d_box_set(&wined3d_src_box, src_box->left, src_box->top, src_box->right, src_box->bottom, src_box->front, src_box->back); @@ -4507,6 +4513,9 @@ static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 * iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, src_resource, src_subresource_idx, src_box);
+ if (!dst_resource || !src_resource) + return; + if (src_box) wined3d_box_set(&wined3d_src_box, src_box->left, src_box->top, src_box->right, src_box->bottom, src_box->front, src_box->back); diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index d25113ff648..67d843ae9e5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -12708,6 +12708,11 @@ static void test_copy_subresource_region(void)
ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_texture, 0, + 1, 1, 0, NULL, 0, &box); + ID3D11DeviceContext_CopySubresourceRegion(context, NULL, 0, + 1, 1, 0, (ID3D11Resource *)src_texture, 0, &box); + set_box(&box, 0, 0, 0, 2, 2, 1); ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_texture, 0, 1, 1, 0, (ID3D11Resource *)src_texture, 0, &box);