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

This commit is contained in:
Henri Verbeet 2009-04-01 12:23:00 +02:00 committed by Alexandre Julliard
parent 19067f1256
commit 4194d8040f

View File

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