From: Patrick Rudolph Date: Sun, 17 May 2015 10:46:42 +0000 (+0200) Subject: st/nine: Fix use of uninitialized values X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=620f3e9bfe4bc56c65638a49b1c4f1d5cbef057d;p=mesa.git st/nine: Fix use of uninitialized values Set all values to 0 after allocation. Found using valgrind. Reviewed-by: Axel Davy Signed-off-by: Patrick Rudolph --- diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 96d27e185b2..e0f3e398ad7 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -2138,8 +2138,10 @@ NineDevice9_SetLight( struct NineDevice9 *This, return E_OUTOFMEMORY; state->ff.num_lights = N; - for (; n < Index; ++n) + for (; n < Index; ++n) { + memset(&state->ff.light[n], 0, sizeof(D3DLIGHT9)); state->ff.light[n].Type = (D3DLIGHTTYPE)NINED3DLIGHT_INVALID; + } } state->ff.light[Index] = *pLight;