From 03371887d513b1357853a290d2faf92ad30c4270 Mon Sep 17 00:00:00 2001 From: Luc Ma Date: Mon, 29 Jan 2024 20:53:54 +0800 Subject: [PATCH] gallium/u_blitter: Fix a few uninitialized fb_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An uninitialized pipe_framebuffer_state maybe causes some issues if someone is about to use its members such as `fb_state.layers`. Signed-off-by: Luc Ma Reported-by: Mark Zhou Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_blitter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index cf058da6396..4d522a526e3 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -2386,7 +2386,7 @@ void util_blitter_clear_render_target(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; bool msaa; unsigned num_layers; blitter_get_vs_func get_vs; @@ -2457,7 +2457,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; struct pipe_stencil_ref sr = { { 0 } }; unsigned num_layers; @@ -2537,7 +2537,7 @@ void util_blitter_custom_depth_stencil(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; assert(zsurf->texture); if (!zsurf->texture) @@ -2671,7 +2671,7 @@ void util_blitter_custom_resolve_color(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; struct pipe_surface *srcsurf, *dstsurf, surf_tmpl; util_blitter_set_running_flag(blitter); @@ -2733,7 +2733,7 @@ void util_blitter_custom_color(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; assert(dstsurf->texture); if (!dstsurf->texture)