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

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Matteo Bruni 2020-03-06 12:33:15 +01:00 committed by Alexandre Julliard
parent 417c36ccb7
commit 9d764892ee
2 changed files with 3 additions and 1 deletions

View File

@ -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')

View File

@ -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();