From beb7ed2b8945e97cd7c5ab816a741be2e2bfb76e Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 16 Sep 2021 00:32:03 +0200 Subject: [PATCH] r300: assert that array in translate_vertex_program is initialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problematic usage is in case RC_OPCODE_ENDLOOP, at line ret_addr = loops[--loop_depth]; Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/r300/compiler/r3xx_vertprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c index 1f1c9adf5be..63cb447363b 100644 --- a/src/gallium/drivers/r300/compiler/r3xx_vertprog.c +++ b/src/gallium/drivers/r300/compiler/r3xx_vertprog.c @@ -369,7 +369,7 @@ static void translate_vertex_program(struct radeon_compiler *c, void *user) struct r300_vertex_program_compiler *compiler = (struct r300_vertex_program_compiler*)c; struct rc_instruction *rci; - unsigned loops[R500_PVS_MAX_LOOP_DEPTH]; + unsigned loops[R500_PVS_MAX_LOOP_DEPTH] = {}; unsigned loop_depth = 0; compiler->code->pos_end = 0; /* Not supported yet */