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

Alexandre Julliard julliard at winehq.org
Thu May 25 14:42:16 CDT 2017


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed May 24 17:09:58 2017 +0200

d3d9: Validate D3DQUERYTYPE.

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/query.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c
index 4ca2205..335a960 100644
--- a/dlls/d3d9/query.c
+++ b/dlls/d3d9/query.c
@@ -185,6 +185,12 @@ HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUER
 {
     HRESULT hr;
 
+    if (type > D3DQUERYTYPE_MEMORYPRESSURE)
+    {
+        WARN("Invalid query type %#x.\n", type);
+        return D3DERR_NOTAVAILABLE;
+    }
+
     query->IDirect3DQuery9_iface.lpVtbl = &d3d9_query_vtbl;
     query->refcount = 1;
 




More information about the wine-cvs mailing list