ddraw: Verify that the surface is a render target in d3d_device_set_render_target().

This commit is contained in:
Henri Verbeet 2013-09-19 10:16:45 +02:00 committed by Alexandre Julliard
parent b7e68ae338
commit ed92369316
1 changed files with 7 additions and 0 deletions

View File

@ -1819,6 +1819,13 @@ static HRESULT d3d_device_set_render_target(struct d3d_device *device,
return DDERR_INVALIDCAPS;
}
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE))
{
WARN("Surface %p is not a render target.\n", target);
wined3d_mutex_unlock();
return DDERR_INVALIDCAPS;
}
if (device->rt_iface == rt_iface)
{
TRACE("No-op SetRenderTarget operation, not doing anything\n");