11 Nov
2019
11 Nov
'19
5:25 p.m.
On Thu, 7 Nov 2019 at 18:25, Conor McCarthy <cmccarthy(a)codeweavers.com> wrote:
+HRESULT CDECL wined3d_update_adapter_memory_info(const struct wined3d *wined3d, unsigned int adapter_idx, + unsigned int non_local, UINT64 bytes_total, UINT64 bytes_used) +{ + struct wined3d_adapter *adapter; + DWORD i; + + wined3d_mutex_lock(); + + if (adapter_idx >= wined3d->adapter_count || non_local >= ARRAY_SIZE(adapter->memory_usage)) + goto fail; + + adapter = wined3d->adapters[adapter_idx]; + adapter->memory_usage[non_local].bytes_used = bytes_used;
This would override any accounting done by adapter_adjust_memory(), and potentially unbalance allocations and frees done through there.