Commit d2d64ced authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

d3drm: Check for NULL pointer in d3drm_viewport2_GetDirect3DViewport().

parent 76a7fe59
......@@ -2155,6 +2155,8 @@ static void test_Viewport(void)
ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
hr = IDirect3DRMViewport_GetDevice(viewport, NULL);
ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
hr = IDirect3DRMViewport_GetDirect3DViewport(viewport, NULL);
ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
IDirect3DRMViewport_Release(viewport);
ref4 = get_refcount((IUnknown *)d3drm1);
......@@ -2245,6 +2247,8 @@ static void test_Viewport(void)
ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %#x.\n", hr);
hr = IDirect3DRMViewport2_GetDevice(viewport2, NULL);
ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, NULL);
ok(hr == D3DRMERR_BADVALUE, "Expected hr == D3DRMERR_BADVALUE, got %#x.\n", hr);
IDirect3DRMViewport2_Release(viewport2);
ref4 = get_refcount((IUnknown *)d3drm1);
......
......@@ -896,6 +896,9 @@ static HRESULT WINAPI d3drm_viewport2_GetDirect3DViewport(IDirect3DRMViewport2 *
TRACE("iface %p, viewport %p.\n", iface, viewport);
if (!viewport)
return D3DRMERR_BADVALUE;
if (!viewport_object->d3d_viewport)
return D3DRMERR_BADOBJECT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment