Henri Verbeet : wined3d: Properly validate the stage index in wined3d_stateblock_set_texture_stage_state() (Coverity).
Alexandre Julliard
julliard at winehq.org
Fri Feb 7 15:41:09 CST 2020
Module: wine
Branch: master
Commit: 125ba807e0d56a2da15875cb485067216505271a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=125ba807e0d56a2da15875cb485067216505271a
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Feb 7 16:20:03 2020 +0330
wined3d: Properly validate the stage index in wined3d_stateblock_set_texture_stage_state() (Coverity).
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/stateblock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index f6d36f8c25..499d23fbbd 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -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;
}
More information about the wine-cvs
mailing list