Module: wine Branch: master Commit: c4e4357eb5058520aec7ccdf40562037f761bafc URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4e4357eb5058520aec7ccdf40...
Author: Józef Kucia jkucia@codeweavers.com Date: Wed May 24 17:09:58 2017 +0200
d3d9: Validate D3DQUERYTYPE.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@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;