Nikolay Sivov : d3d8: Fix token type checks in convert_to_wined3d_declaration (Coverity).
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jun 3 09:43:08 CDT 2015
Module: wine
Branch: master
Commit: 3d6ee7e5b9fa22e844eaa6177bf146aad4a05777
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3d6ee7e5b9fa22e844eaa6177bf146aad4a05777
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Jun 3 11:45:25 2015 +0300
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 4be9127..968b76b 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);
}
More information about the wine-cvs
mailing list