Commit 9edeb22c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Verify the viewport belongs to the device in IDirect3DDeviceImpl_3_SetCurrentViewport().

parent e30a0574
...@@ -1742,7 +1742,12 @@ IDirect3DDeviceImpl_3_SetCurrentViewport(IDirect3DDevice3 *iface, ...@@ -1742,7 +1742,12 @@ IDirect3DDeviceImpl_3_SetCurrentViewport(IDirect3DDevice3 *iface,
return D3D_OK; return D3D_OK;
} }
/* Should check if the viewport was added or not */ if (vp->active_device != This)
{
WARN("Viewport %p active device is %p.\n", vp, vp->active_device);
LeaveCriticalSection(&ddraw_cs);
return DDERR_INVALIDPARAMS;
}
/* Release previous viewport and AddRef the new one */ /* Release previous viewport and AddRef the new one */
if (This->current_viewport) if (This->current_viewport)
...@@ -1757,7 +1762,6 @@ IDirect3DDeviceImpl_3_SetCurrentViewport(IDirect3DDevice3 *iface, ...@@ -1757,7 +1762,6 @@ IDirect3DDeviceImpl_3_SetCurrentViewport(IDirect3DDevice3 *iface,
This->current_viewport = vp; This->current_viewport = vp;
/* Activate this viewport */ /* Activate this viewport */
This->current_viewport->active_device = This;
viewport_activate(This->current_viewport, FALSE); viewport_activate(This->current_viewport, FALSE);
LeaveCriticalSection(&ddraw_cs); LeaveCriticalSection(&ddraw_cs);
......
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