forked from Mirrors/wine-wine
wined3d: Properly validate the stage index in wined3d_stateblock_set_texture_stage_state() (Coverity).
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 125ba807e0
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
stable
parent
1653bff666
commit
0813ec9c91
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue