d3d8: Fix token type checks in convert_to_wined3d_declaration (Coverity).

This commit is contained in:
Nikolay Sivov 2015-06-03 11:45:25 +03:00 committed by Alexandre Julliard
parent b7969dfd94
commit 3d6ee7e5b9
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}