=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d9: Validate presentation interval.

Alexandre Julliard julliard at winehq.org
Mon Mar 12 17:40:24 CDT 2018


Module: wine
Branch: master
Commit: 9d62b50cafc845dfa06b911ac745b8569a3ba46b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9d62b50cafc845dfa06b911ac745b8569a3ba46b

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Mar 12 13:53:50 2018 +0100

d3d9: Validate presentation interval.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d9/device.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 28c96c4..8c74494 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -331,6 +331,19 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
         WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount);
         return FALSE;
     }
+    switch (present_parameters->PresentationInterval)
+    {
+        case D3DPRESENT_INTERVAL_DEFAULT:
+        case D3DPRESENT_INTERVAL_ONE:
+        case D3DPRESENT_INTERVAL_TWO:
+        case D3DPRESENT_INTERVAL_THREE:
+        case D3DPRESENT_INTERVAL_FOUR:
+        case D3DPRESENT_INTERVAL_IMMEDIATE:
+            break;
+        default:
+            WARN("Invalid presentation interval %#x.\n", present_parameters->PresentationInterval);
+            return FALSE;
+    }
 
     swapchain_desc->backbuffer_width = present_parameters->BackBufferWidth;
     swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight;




More information about the wine-cvs mailing list