From 16f8da299700e714fd5aff265b8f28fe2badfa95 Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Fri, 10 Nov 2017 13:11:53 +0100 Subject: ddebug: fix use-after-free of streamout targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: b47727a83ad6 ("ddebug: implement pipelined hang detection mode") Reviewed-by: Marek Olšák --- src/gallium/drivers/ddebug/dd_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c index a25017114d8..e908410a33d 100644 --- a/src/gallium/drivers/ddebug/dd_draw.c +++ b/src/gallium/drivers/ddebug/dd_draw.c @@ -767,7 +767,7 @@ dd_copy_draw_state(struct dd_draw_state *dst, struct dd_draw_state *src) } dst->num_so_targets = src->num_so_targets; - for (i = 0; i < ARRAY_SIZE(src->so_targets); i++) + for (i = 0; i < src->num_so_targets; i++) pipe_so_target_reference(&dst->so_targets[i], src->so_targets[i]); memcpy(dst->so_offsets, src->so_offsets, sizeof(src->so_offsets)); -- cgit v1.2.3