Commit 4194d804 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Filter invalid texture stage states passed by the application.

parent 19067f12
......@@ -4776,6 +4776,13 @@ IDirect3DDeviceImpl_7_GetTextureStageState(IDirect3DDevice7 *iface,
if(!State)
return DDERR_INVALIDPARAMS;
if (TexStageStateType > D3DTSS_TEXTURETRANSFORMFLAGS)
{
WARN("Invalid TexStageStateType %#x passed.\n", TexStageStateType);
*State = 0;
return DD_OK;
}
EnterCriticalSection(&ddraw_cs);
if (l->sampler_state)
......@@ -4896,6 +4903,12 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
HRESULT hr;
TRACE("(%p)->(%08x,%08x,%08x): Relay!\n", This, Stage, TexStageStateType, State);
if (TexStageStateType > D3DTSS_TEXTURETRANSFORMFLAGS)
{
WARN("Invalid TexStageStateType %#x passed.\n", TexStageStateType);
return DD_OK;
}
EnterCriticalSection(&ddraw_cs);
if (l->sampler_state)
......
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