Commit fcb5b6c3 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Use param->bytes for copying the data in ID3DXBaseEffect::SetValue().

parent 57e49121
...@@ -1623,7 +1623,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetValue(ID3DXBaseEffect *iface, D3DXH ...@@ -1623,7 +1623,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetValue(ID3DXBaseEffect *iface, D3DXH
return E_FAIL; return E_FAIL;
} }
if (data && param->bytes >= bytes) if (data && param->bytes <= bytes)
{ {
switch (param->type) switch (param->type)
{ {
...@@ -1631,8 +1631,8 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetValue(ID3DXBaseEffect *iface, D3DXH ...@@ -1631,8 +1631,8 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetValue(ID3DXBaseEffect *iface, D3DXH
case D3DXPT_BOOL: case D3DXPT_BOOL:
case D3DXPT_INT: case D3DXPT_INT:
case D3DXPT_FLOAT: case D3DXPT_FLOAT:
TRACE("Copy %u bytes\n", bytes); TRACE("Copy %u bytes\n", param->bytes);
memcpy(param->data, data, bytes); memcpy(param->data, data, param->bytes);
break; break;
default: default:
...@@ -3580,7 +3580,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetStateManager(ID3DXEffect *iface, LPD3DX ...@@ -3580,7 +3580,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetStateManager(ID3DXEffect *iface, LPD3DX
TRACE("iface %p, manager %p\n", This, manager); TRACE("iface %p, manager %p\n", This, manager);
if (manager) IUnknown_AddRef(manager); if (manager) IUnknown_AddRef(manager);
if (This->manager) IUnknown_Release(This->manager); if (This->manager) IUnknown_Release(This->manager);
This->manager = manager; This->manager = manager;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment