Module: wine Branch: master Commit: d9051bbe93b470197a22cf1e21d26f5b7fb9ecbf URL: http://source.winehq.org/git/wine.git/?a=commit;h=d9051bbe93b470197a22cf1e21...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Sun Jan 13 22:08:07 2013 +0100
ddraw: Only check dwFlags if we actually have a D3DLIGHT2 structure in d3d_light_SetLight().
---
dlls/ddraw/light.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/ddraw/light.c b/dlls/ddraw/light.c index ebc1410..1d81803 100644 --- a/dlls/ddraw/light.c +++ b/dlls/ddraw/light.c @@ -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;