[PATCH 2/5] ddraw: Require a non-zero back buffer count for swap chains.

Henri Verbeet hverbeet at codeweavers.com
Thu Dec 5 03:34:15 CST 2013


---
 dlls/ddraw/surface.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 7cb18a1..4c96da8 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5647,6 +5647,13 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
                 return DDERR_INVALIDCAPS;
             }
 
+            if (!(desc->dwFlags & DDSD_BACKBUFFERCOUNT) || !desc->dwBackBufferCount)
+            {
+                WARN("Tried to create a flippable primary surface without any back buffers.\n");
+                HeapFree(GetProcessHeap(), 0, texture);
+                return DDERR_INVALIDCAPS;
+            }
+
             if (!(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
             {
                 WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
-- 
1.7.10.4




More information about the wine-patches mailing list