[PATCH 1/5] wined3d: Don't set a NULL container of type WINED3D_CONTAINER_TEXTURE.

Henri Verbeet hverbeet at codeweavers.com
Wed Aug 25 13:46:49 CDT 2010


Any container type other than WINED3D_CONTAINER_NONE implies a valid pointer
of the specified type. This fixes a regression introduced by
368e5eb87ae983e4ea2f66b3ca2f4154b36bbcda.
---
 dlls/wined3d/device.c  |    2 +-
 dlls/wined3d/surface.c |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 963d132..c3d0976 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5663,7 +5663,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
         TRACE("Changing the back buffer from %p to %p.\n", swapchain->back_buffers[0], back_impl);
 
         if (swapchain->back_buffers[0])
-            surface_set_container(swapchain->back_buffers[0], WINED3D_CONTAINER_TEXTURE, NULL);
+            surface_set_container(swapchain->back_buffers[0], WINED3D_CONTAINER_NONE, NULL);
         swapchain->back_buffers[0] = back_impl;
 
         if (back_impl)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 662ef7b..93559a1 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -96,6 +96,9 @@ void surface_set_container(IWineD3DSurfaceImpl *surface, enum wined3d_container_
 {
     TRACE("surface %p, container %p.\n", surface, container);
 
+    if (!container && type != WINED3D_CONTAINER_NONE)
+        ERR("Setting NULL container of type %#x.\n", type);
+
     if (type == WINED3D_CONTAINER_SWAPCHAIN)
     {
         surface->get_drawable_size = get_drawable_size_swapchain;
-- 
1.7.1




More information about the wine-patches mailing list