Commit 9d764892 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3d8: Range-check GetPixelShaderConstant() indices to the d3d8 limit.

parent 417c36cc
......@@ -40,6 +40,7 @@
#define D3DPRESENTFLAGS_MASK 0x00000fffu
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
#define D3D8_MAX_PIXEL_SHADER_CONSTANTF 8
#define D3D8_MAX_STREAMS 16
#define D3DFMT_RESZ MAKEFOURCC('R','E','S','Z')
......
......@@ -3295,7 +3295,8 @@ static HRESULT WINAPI d3d8_device_GetPixelShaderConstant(IDirect3DDevice8 *iface
TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
if (!constants || start_idx >= WINED3D_MAX_PS_CONSTS_F || count > WINED3D_MAX_PS_CONSTS_F - start_idx)
if (!constants || start_idx >= D3D8_MAX_PIXEL_SHADER_CONSTANTF
|| count > D3D8_MAX_PIXEL_SHADER_CONSTANTF - start_idx)
return WINED3DERR_INVALIDCALL;
wined3d_mutex_lock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment