From 00e100de08bb0d684bff069c9f302cbad2357e34 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Jul 2021 07:41:18 -0400 Subject: render_target: Add missing initializer for size extent Everything else has a default constructor that does the straightforward thing of initializing most members to a default value, except for the size. We explicitly initialize the size (and others, for consistency), to prevent potential uninitialized reads from occurring. Particularly given the largeish surface area that this struct is used in. --- src/video_core/texture_cache/render_targets.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/texture_cache/render_targets.h b/src/video_core/texture_cache/render_targets.h index 9b9544b07..0cb227d69 100644 --- a/src/video_core/texture_cache/render_targets.h +++ b/src/video_core/texture_cache/render_targets.h @@ -24,10 +24,10 @@ struct RenderTargets { return std::ranges::any_of(color_buffer_ids, contains) || contains(depth_buffer_id); } - std::array color_buffer_ids; - ImageViewId depth_buffer_id; + std::array color_buffer_ids{}; + ImageViewId depth_buffer_id{}; std::array draw_buffers{}; - Extent2D size; + Extent2D size{}; }; } // namespace VideoCommon -- cgit v1.2.3