From 620f3e9bfe4bc56c65638a49b1c4f1d5cbef057d Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 17 May 2015 12:46:42 +0200 Subject: 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 --- src/gallium/state_trackers/nine/device9.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3