Skip to content

Commit

Permalink
Fixed null crash on textures (#694)
Browse files Browse the repository at this point in the history
* Fixed null crash on textures

* Fixed tidy
  • Loading branch information
KiritoDv authored Oct 22, 2024
1 parent 9ec8b98 commit cd7721f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/graphic/Fast3D/gfx_pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cd7721f

Please sign in to comment.