Commit 2b5b069d authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

d3dx9: Validate state operation in d3dx_parse_state().

parent f925becd
......@@ -5564,6 +5564,12 @@ static HRESULT d3dx_parse_state(struct d3dx_effect *effect, struct d3dx_state *s
state->type = ST_CONSTANT;
read_dword(ptr, &state->operation);
if (state->operation >= ARRAY_SIZE(state_table))
{
WARN("Unknown state operation %u.\n", state->operation);
return D3DERR_INVALIDCALL;
}
TRACE("Operation: %#x (%s)\n", state->operation, state_table[state->operation].name);
read_dword(ptr, &state->index);
......
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