From: Nicolai Hähnle Date: Fri, 10 Nov 2017 12:11:53 +0000 (+0100) Subject: ddebug: fix use-after-free of streamout targets X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16f8da299700e714fd5aff265b8f28fe2badfa95;p=mesa.git ddebug: fix use-after-free of streamout targets Fixes: b47727a83ad6 ("ddebug: implement pipelined hang detection mode") Reviewed-by: Marek Olšák --- 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));