d3dx9: Don't add const setting entries with zero count.

Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2017-05-31 23:35:52 +02:00 committed by Alexandre Julliard
parent 1816d8a9fa
commit 4c7653ef5d
1 changed files with 5 additions and 0 deletions
dlls/d3dx9_36

View File

@ -1226,6 +1226,11 @@ static HRESULT init_set_constants_param(struct d3dx_const_tab *const_tab, ID3DXC
const_set.register_count = desc.RegisterCount;
table_type = table_info[const_set.table].type;
get_const_upload_info(&const_set, &info);
if (!info.count)
{
TRACE("%s has zero count, skipping.\n", debugstr_a(param->name));
return D3D_OK;
}
if (table_type_from_param_type(param->type) == PRES_VT_COUNT)
return D3DERR_INVALIDCALL;