Henri Verbeet : ddraw: Require a non-zero back buffer count for swap chains .

Alexandre Julliard julliard at winehq.org
Thu Dec 5 12:49:16 CST 2013


Module: wine
Branch: master
Commit: 8797a9eda3f4ccc256cb0716389d8225da6c4615
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8797a9eda3f4ccc256cb0716389d8225da6c4615

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Dec  5 10:34:15 2013 +0100

ddraw: Require a non-zero back buffer count for swap chains.

---

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

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");




More information about the wine-cvs mailing list