mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-01 16:05:07 +01: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
@ -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()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user