diff options
author | Patrick Rudolph <[email protected]> | 2015-01-16 07:34:36 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-02-06 00:07:19 +0100 |
commit | 63221c6f0944bf82eee07a54c42a473890ee655c (patch) | |
tree | 10b6be117d406b9b03e5181500f9074b2c601de6 /src/gallium/state_trackers | |
parent | 2dcad120a04ac42987756d244125bb814e5ca5f5 (diff) |
st/nine: Fix bufferoverflow in {Get|Set}PixelShaderConstantF
Previous code wasn't checking against the correct limit: 224
for sm3 hardware, but 256.
Fixes wine test test_pixel_shader_constant()
Reviewed-by: Axel Davy <[email protected]>
Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/device9.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index fdcf7a28756..dfec5f91770 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -256,7 +256,7 @@ NineDevice9_ctor( struct NineDevice9 *This, NINE_MAX_CONST_ALL); /* ps 3.0: 224 float constants. All cards supported support at least * 256 constants for ps */ - max_const_ps = 224 + (NINE_MAX_CONST_I + NINE_MAX_CONST_B / 4); + max_const_ps = NINE_MAX_CONST_F_PS3 + (NINE_MAX_CONST_I + NINE_MAX_CONST_B / 4); This->max_vs_const_f = max_const_vs - (NINE_MAX_CONST_I + NINE_MAX_CONST_B / 4); @@ -3309,8 +3309,8 @@ NineDevice9_SetPixelShaderConstantF( struct NineDevice9 *This, DBG("This=%p StartRegister=%u pConstantData=%p Vector4fCount=%u\n", This, StartRegister, pConstantData, Vector4fCount); - user_assert(StartRegister < NINE_MAX_CONST_F, D3DERR_INVALIDCALL); - user_assert(StartRegister + Vector4fCount <= NINE_MAX_CONST_F, D3DERR_INVALIDCALL); + user_assert(StartRegister < NINE_MAX_CONST_F_PS3, D3DERR_INVALIDCALL); + user_assert(StartRegister + Vector4fCount <= NINE_MAX_CONST_F_PS3, D3DERR_INVALIDCALL); if (!Vector4fCount) return D3D_OK; @@ -3337,8 +3337,8 @@ NineDevice9_GetPixelShaderConstantF( struct NineDevice9 *This, { const struct nine_state *state = &This->state; - user_assert(StartRegister < NINE_MAX_CONST_F, D3DERR_INVALIDCALL); - user_assert(StartRegister + Vector4fCount <= NINE_MAX_CONST_F, D3DERR_INVALIDCALL); + user_assert(StartRegister < NINE_MAX_CONST_F_PS3, D3DERR_INVALIDCALL); + user_assert(StartRegister + Vector4fCount <= NINE_MAX_CONST_F_PS3, D3DERR_INVALIDCALL); user_assert(pConstantData, D3DERR_INVALIDCALL); memcpy(pConstantData, |