Mesa (main): vc4: initialize array

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 21 15:31:27 UTC 2021


Module: Mesa
Branch: main
Commit: 7e767ffeb36a7a1de22a73eebca8d7c10034313d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e767ffeb36a7a1de22a73eebca8d7c10034313d

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Fri May 21 12:36:23 2021 +0200

vc4: initialize array

This fixes a (rather false) error about accessing an array that it is
uninitialized.

Fixes: 7bc39c8418e ("vc4: Add a dump-the-surface-contents routine.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4816
Cc: mesa-stable
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10918>

---

 src/gallium/drivers/vc4/vc4_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index c1550de3ff3..61e5fd7e5a6 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -768,7 +768,7 @@ vc4_dump_surface_non_msaa(struct pipe_surface *psurf)
         uint32_t height = psurf->height;
         uint32_t chunk_w = width / 79;
         uint32_t chunk_h = height / 40;
-        uint32_t found_colors[10];
+        uint32_t found_colors[10] = { 0 };
         uint32_t num_found_colors = 0;
 
         if (rsc->vc4_format != VC4_TEXTURE_TYPE_RGBA32R) {



More information about the mesa-commit mailing list