From cd7721fae2459d17630a45334b3fcfd532fa33fb Mon Sep 17 00:00:00 2001 From: Lywx Date: Tue, 22 Oct 2024 15:45:02 -0600 Subject: [PATCH] Fixed null crash on textures (#694) * Fixed null crash on textures * Fixed tidy --- src/graphic/Fast3D/gfx_pc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graphic/Fast3D/gfx_pc.cpp b/src/graphic/Fast3D/gfx_pc.cpp index 18a47c3f9..892f91ac4 100644 --- a/src/graphic/Fast3D/gfx_pc.cpp +++ b/src/graphic/Fast3D/gfx_pc.cpp @@ -1621,6 +1621,10 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo cmt &= ~G_TX_CLAMP; } + if (rendering_state.textures[i] == nullptr) { + continue; + } + bool linear_filter = (g_rdp.other_mode_h & (3U << G_MDSFT_TEXTFILT)) != G_TF_POINT; if (linear_filter != rendering_state.textures[i]->second.linear_filter || cms != rendering_state.textures[i]->second.cms || cmt != rendering_state.textures[i]->second.cmt) {