From e9bc99253dff335ceae7f4b1b60aa10b66efe6cc Mon Sep 17 00:00:00 2001 From: kd-11 Date: Thu, 3 Oct 2024 14:06:26 +0300 Subject: [PATCH] rsx: Verify that channel remap is initialized before applying swizzles --- rpcs3/Emu/RSX/color_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/RSX/color_utils.h b/rpcs3/Emu/RSX/color_utils.h index 389c6b7d4b..1f78a18202 100644 --- a/rpcs3/Emu/RSX/color_utils.h +++ b/rpcs3/Emu/RSX/color_utils.h @@ -8,13 +8,15 @@ namespace rsx { struct texture_channel_remap_t { - u32 encoded; + u32 encoded = 0xDEAD; std::array control_map; std::array channel_map; template std::array remap(const std::array& components, T select_zero, T select_one) const { + ensure(encoded != 0xDEAD, "Channel remap was not initialized"); + std::array remapped{}; for (u8 channel = 0; channel < 4; ++channel) {