mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 05:08:23 +00:00
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
1 changed files with 2 additions and 3 deletions
|
@ -78,12 +78,11 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup,
|
|||
(float_regs_counter >= 3 && !uniform_setup.IsFloat32())) {
|
||||
float_regs_counter = 0;
|
||||
|
||||
auto& uniform = setup.uniforms.f[uniform_setup.index];
|
||||
|
||||
if (uniform_setup.index >= 96) {
|
||||
if (uniform_setup.index >= setup.uniforms.f.size()) {
|
||||
LOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup),
|
||||
(int)uniform_setup.index);
|
||||
} else {
|
||||
auto& uniform = setup.uniforms.f[uniform_setup.index];
|
||||
|
||||
// NOTE: The destination component order indeed is "backwards"
|
||||
if (uniform_setup.IsFloat32()) {
|
||||
|
|
Loading…
Reference in a new issue