1
0
Fork 0
forked from suyu/suyu

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
This commit is contained in:
Billy Laws 2023-01-07 18:38:21 +00:00 committed by GitHub
parent 432d48d9c8
commit d34275a260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,7 +259,7 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
program.is_geometry_passthrough = sph.common0.geometry_passthrough != 0; program.is_geometry_passthrough = sph.common0.geometry_passthrough != 0;
if (program.is_geometry_passthrough) { if (program.is_geometry_passthrough) {
const auto& mask{env.GpPassthroughMask()}; 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; program.info.passthrough.mask[i] = ((mask[i / 32] >> (i % 32)) & 1) == 0;
} }