diff --git a/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp b/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp index 38cc1fe9a0..f93f44485f 100644 --- a/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp +++ b/rpcs3/Emu/RSX/Program/CgBinaryVertexProgram.cpp @@ -109,6 +109,8 @@ std::string CgBinaryDisasm::GetDSTDisasm(bool is_sca) std::string CgBinaryDisasm::GetSRCDisasm(const u32 n) { + ensure(n < 3); + std::string ret; static constexpr std::array reg_table = @@ -171,6 +173,7 @@ std::string CgBinaryDisasm::GetSRCDisasm(const u32 n) switch (n) { + default: case 0: abs = d0.src0_abs; break; case 1: abs = d0.src1_abs; break; case 2: abs = d0.src2_abs; break; diff --git a/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp index 6d16a931d1..7cb7d578a4 100644 --- a/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Program/VertexProgramDecompiler.cpp @@ -96,6 +96,8 @@ std::string VertexProgramDecompiler::GetDST(bool is_sca) std::string VertexProgramDecompiler::GetSRC(const u32 n) { + ensure(n < 3); + static const std::string reg_table[] = { "in_pos", "in_weight", "in_normal", @@ -152,6 +154,7 @@ std::string VertexProgramDecompiler::GetSRC(const u32 n) switch (n) { + default: case 0: abs = d0.src0_abs; break; case 1: abs = d0.src1_abs; break; case 2: abs = d0.src2_abs; break;