Commit d9051bbe authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Only check dwFlags if we actually have a D3DLIGHT2 structure in d3d_light_SetLight().

parent d210b875
......@@ -210,7 +210,7 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
/* Translate D3DLIGHT2 structure to D3DLIGHT7. */
light7->dltType = data->dltType;
light7->dcvDiffuse = data->dcvColor;
if (((D3DLIGHT2 *)data)->dwFlags & D3DLIGHT_NO_SPECULAR)
if (data->dwSize >= sizeof(D3DLIGHT2) && (((D3DLIGHT2 *)data)->dwFlags & D3DLIGHT_NO_SPECULAR))
light7->dcvSpecular = data->dcvColor;
else
light7->dcvSpecular = *(const D3DCOLORVALUE *)zero_value;
......
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