From 3d6ee7e5b9fa22e844eaa6177bf146aad4a05777 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 3 Jun 2015 11:45:25 +0300 Subject: [PATCH] d3d8: Fix token type checks in convert_to_wined3d_declaration (Coverity). --- dlls/d3d8/vertexdeclaration.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c index 4be91279f0d..968b76b2259 100644 --- a/dlls/d3d8/vertexdeclaration.c +++ b/dlls/d3d8/vertexdeclaration.c @@ -275,7 +275,7 @@ static UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3 { stream = ((*token & D3DVSD_STREAMNUMBERMASK) >> D3DVSD_STREAMNUMBERSHIFT); offset = 0; - } else if (token_type == D3DVSD_TOKEN_STREAMDATA && !(token_type & 0x10000000)) { + } else if (token_type == D3DVSD_TOKEN_STREAMDATA && !(*token & D3DVSD_DATALOADTYPEMASK)) { DWORD type = ((*token & D3DVSD_DATATYPEMASK) >> D3DVSD_DATATYPESHIFT); DWORD reg = ((*token & D3DVSD_VERTEXREGMASK) >> D3DVSD_VERTEXREGSHIFT); @@ -293,7 +293,7 @@ static UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3 element->usage_idx = wined3d_usage_lookup[reg].usage_idx; offset += wined3d_type_sizes[type]; - } else if (token_type == D3DVSD_TOKEN_STREAMDATA && (token_type & 0x10000000)) { + } else if (token_type == D3DVSD_TOKEN_STREAMDATA && (*token & D3DVSD_DATALOADTYPEMASK)) { TRACE(" 0x%08x SKIP(%u)\n", token_type, ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT)); offset += sizeof(DWORD) * ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT); }