command_processor: Fix out-of-bounds float-uniform access (#7111)
Addresses: https://github.com/citra-emu/citra/issues/6696 https://github.com/citra-emu/citra/issues/6871
This commit is contained in:
parent
b5d744bcae
commit
b10f3d96f5
|
@ -78,12 +78,11 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup,
|
||||||
(float_regs_counter >= 3 && !uniform_setup.IsFloat32())) {
|
(float_regs_counter >= 3 && !uniform_setup.IsFloat32())) {
|
||||||
float_regs_counter = 0;
|
float_regs_counter = 0;
|
||||||
|
|
||||||
auto& uniform = setup.uniforms.f[uniform_setup.index];
|
if (uniform_setup.index >= setup.uniforms.f.size()) {
|
||||||
|
|
||||||
if (uniform_setup.index >= 96) {
|
|
||||||
LOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup),
|
LOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup),
|
||||||
(int)uniform_setup.index);
|
(int)uniform_setup.index);
|
||||||
} else {
|
} else {
|
||||||
|
auto& uniform = setup.uniforms.f[uniform_setup.index];
|
||||||
|
|
||||||
// NOTE: The destination component order indeed is "backwards"
|
// NOTE: The destination component order indeed is "backwards"
|
||||||
if (uniform_setup.IsFloat32()) {
|
if (uniform_setup.IsFloat32()) {
|
||||||
|
|
Reference in New Issue