Commit 125ba807 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Properly validate the stage index in…

wined3d: Properly validate the stage index in wined3d_stateblock_set_texture_stage_state() (Coverity). Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9f676b71
......@@ -1459,10 +1459,10 @@ void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock
return;
}
if (stage > WINED3D_MAX_TEXTURES)
if (stage >= WINED3D_MAX_TEXTURES)
{
WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n",
stage, WINED3D_MAX_TEXTURES);
stage, WINED3D_MAX_TEXTURES - 1);
return;
}
......
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