summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-05-17 12:46:42 +0200
committerAxel Davy <[email protected]>2015-08-21 22:21:46 +0200
commit620f3e9bfe4bc56c65638a49b1c4f1d5cbef057d (patch)
tree9e6e52b8612f6a456d00ffe16099017562e4dbfe /src/gallium/state_trackers/nine/device9.c
parent248833ff4072da4f3362dc9f0eab84eb015f3964 (diff)
st/nine: Fix use of uninitialized values
Set all values to 0 after allocation. Found using valgrind. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c4
1 files changed, 3 insertions, 1 deletions
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;