aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/translate_program.cpp
diff options
context:
space:
mode:
authorBilly Laws <blaws05@gmail.com>2023-01-07 18:38:21 +0000
committerGitHub <noreply@github.com>2023-01-07 18:38:21 +0000
commitea68f05d8ff38bc7bd7803c4320002651e79f438 (patch)
tree1043be28e9536446d10074982581758b66ff3a24 /src/shader_recompiler/frontend/maxwell/translate_program.cpp
parenta445e93e5202619b36ff9defe59ba7570fbc1c94 (diff)
Avoid OOB array access reading passthrough attr mask
YFC 1.5 extended the size of the varying mask used to hold passthrough attrs without considering this
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate_program.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
index a3b99e24d7..a42453e90a 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp
@@ -259,7 +259,7 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
program.is_geometry_passthrough = sph.common0.geometry_passthrough != 0;
if (program.is_geometry_passthrough) {
const auto& mask{env.GpPassthroughMask()};
- for (size_t i = 0; i < program.info.passthrough.mask.size(); ++i) {
+ for (size_t i = 0; i < mask.size() * 32; ++i) {
program.info.passthrough.mask[i] = ((mask[i / 32] >> (i % 32)) & 1) == 0;
}