[PATCH 3/5] d3d9: Retrieve vertex shader constants from the primary stateblock.
Henri Verbeet
hverbeet at gmail.com
Mon Feb 10 08:37:19 CST 2020
On Sat, 8 Feb 2020 at 07:42, Zebediah Figura <z.figura12 at gmail.com> wrote:
> + if (reg_idx >= device->vs_uniform_count || reg_idx + count > device->vs_uniform_count)
> {
"reg_idx + count" can overflow. In principle that's an existing issue,
but previously wined3d_device_get_vs_consts_f() would have caught it.
> - hr = wined3d_device_get_vs_consts_i(device->wined3d_device,
> - reg_idx, count, (struct wined3d_ivec4 *)data);
> + memcpy(data, &wined3d_stateblock_get_state(device->state)->vs_consts_i[reg_idx], count * sizeof(struct wined3d_ivec4));
It's just a tought, but the following may be slightly more natural:
const struct wined3d_ivec4 *src =
wined3d_stateblock_get_state(device->state)->vs_consts_i;
memcpy(data, &src[reg_idx], count * sizeof(*src));
More information about the wine-devel
mailing list