[PATCH 2/5] wined3d: Don't return a surface for a NULL dc in wined3d_device_get_surface_from_dc().

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 23 01:51:42 CST 2011


The tests for this in ddraw currently happen to succeed because there are no
surfaces without a DC at the point the tests are run. This will change at some
point when we create the ddraw swapchain earlier.
---
 dlls/wined3d/device.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7e70841..db849a4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5871,6 +5871,9 @@ HRESULT CDECL wined3d_device_get_surface_from_dc(const struct wined3d_device *de
 
     TRACE("device %p, dc %p, surface %p.\n", device, dc, surface);
 
+    if (!dc)
+        return WINED3DERR_INVALIDCALL;
+
     LIST_FOR_EACH_ENTRY(resource, &device->resources, struct wined3d_resource, resource_list_entry)
     {
         if (resource->resourceType == WINED3DRTYPE_SURFACE)
-- 
1.7.3.4




More information about the wine-patches mailing list