[PATCH 1/5] ddraw: Verify that the surface is a render target in d3d_device_set_render_target().
Henri Verbeet
hverbeet at codeweavers.com
Thu Sep 19 03:16:45 CDT 2013
---
dlls/ddraw/device.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 3f3cb18..9ec9d1d 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -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");
--
1.7.10.4
More information about the wine-patches
mailing list