From a82e67812a18208643919f44066452bd06558797 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sun, 16 Aug 2015 21:39:42 +0200 Subject: [PATCH] st/nine: Initialize lights in stateblocks This fixes a crash. Signed-off-by: Axel Davy Reviewed-by: Patrick Rudolph --- src/gallium/state_trackers/nine/stateblock9.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/stateblock9.c index 6d6e1be0b7f..77039596fdc 100644 --- a/src/gallium/state_trackers/nine/stateblock9.c +++ b/src/gallium/state_trackers/nine/stateblock9.c @@ -269,6 +269,10 @@ nine_state_copy_common(struct nine_state *dst, dst->ff.light = REALLOC(dst->ff.light, dst->ff.num_lights * sizeof(D3DLIGHT9), mask->ff.num_lights * sizeof(D3DLIGHT9)); + for (i = dst->ff.num_lights; i < mask->ff.num_lights; ++i) { + memset(&dst->ff.light[i], 0, sizeof(D3DLIGHT9)); + dst->ff.light[i].Type = (D3DLIGHTTYPE)NINED3DLIGHT_INVALID; + } dst->ff.num_lights = mask->ff.num_lights; } for (i = 0; i < mask->ff.num_lights; ++i) -- 2.30.2