From edc56f944af145dda281202c22ecb768a05b0f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 25 Jan 2024 11:44:30 +0100 Subject: [PATCH] zink: Initialize pipe_query_result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid reading garbage from memory. Found by the clang static analyzer Signed-off-by: Corentin Noël Part-of: --- src/gallium/drivers/zink/zink_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index a02cc05f0c8..589d8288293 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -724,7 +724,7 @@ force_cpu_read(struct zink_context *ctx, struct pipe_query *pquery, enum pipe_qu struct pipe_context *pctx = &ctx->base; unsigned result_size = result_type <= PIPE_QUERY_TYPE_U32 ? sizeof(uint32_t) : sizeof(uint64_t); struct zink_query *query = (struct zink_query*)pquery; - union pipe_query_result result; + union pipe_query_result result = {0}; if (query->needs_update) update_qbo(ctx, query);