[PATCH] d3dx9_36: fixed off by 1 in the usage_idx check (Coverity)

Marcus Meissner marcus at jet.franken.de
Tue May 25 16:40:59 CDT 2010


Hi,

                    This->oT_regnum[usage_idx] = regnum;

and oT_regnum is of size 8.

Ciao, Marcus
---
 dlls/d3dx9_36/bytecodewriter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/bytecodewriter.c b/dlls/d3dx9_36/bytecodewriter.c
index 384fed3..055b8ef 100644
--- a/dlls/d3dx9_36/bytecodewriter.c
+++ b/dlls/d3dx9_36/bytecodewriter.c
@@ -435,7 +435,7 @@ static HRESULT vs_find_builtin_varyings(struct bc_writer *This, const struct bwr
                 break;
 
             case BWRITERDECLUSAGE_TEXCOORD:
-                if(usage_idx > 8) {
+                if(usage_idx >= 8) {
                     WARN("dcl_color%u not supported in sm 1/2 shaders\n", usage_idx);
                     return E_INVALIDARG;
                 }
-- 
1.5.6



More information about the wine-patches mailing list