From: Paul Gofman Subject: [v4 1/4] d3dx9: Remove redundant parameter size check in set_constants(). Message-Id: <20170619092424.29507-1-gofmanp@gmail.com> Date: Mon, 19 Jun 2017 12:24:21 +0300 Signed-off-by: Paul Gofman --- v4: - added assert() for parameter size. --- dlls/d3dx9_36/preshader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx9_36/preshader.c b/dlls/d3dx9_36/preshader.c index 2785ca3..76d6de9 100644 --- a/dlls/d3dx9_36/preshader.c +++ b/dlls/d3dx9_36/preshader.c @@ -1178,11 +1178,6 @@ static void set_constants(struct d3dx_regstore *rs, struct d3dx_const_tab *const param_offset = i + j * info.major; else param_offset = i * info.minor + j; - if (param_offset * sizeof(unsigned int) >= param->bytes) - { - WARN("Parameter data is too short, name %s, component %u.\n", debugstr_a(param->name), i); - break; - } out[offset] = data[param_offset]; } } @@ -1303,6 +1298,11 @@ static HRESULT merge_const_set_entries(struct d3dx_const_tab *const_tab, memmove(&const_tab->const_set[index + 1], &const_tab->const_set[i], sizeof(*const_tab->const_set) * (const_tab->const_set_count - i)); const_tab->const_set_count -= i - index - 1; + assert(param->bytes >= table_info[first_const->table].component_size + * first_const->element_count + * (first_const->direct_copy ? get_reg_components(first_const->table) + * first_const->register_count + : first_const->param->rows * first_const->param->columns)); } else { -- 2.9.4