CTevCombiners: I overlooked a possible buffer overrun, fix it by using `maxTevStages` instead of `ERglTevStage::MAX`

This commit is contained in:
Phillip Stephens 2022-03-07 22:19:07 -08:00
parent 791b1fa598
commit eb17b8061d
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 2 additions and 2 deletions

View File

@ -95,8 +95,8 @@ bool SetPassCombiners(ERglTevStage stage, const CTevPass& pass) {
} }
void RecomputePasses() { void RecomputePasses() {
sNumEnabledPasses = 1 - static_cast<int>(sValidPasses[1]); sNumEnabledPasses = 1 - static_cast<int>(sValidPasses[maxTevPasses - 1]);
for (u32 i = sNumEnabledPasses; i < u32(ERglTevStage::MAX); ++i) { for (u32 i = sNumEnabledPasses; i < maxTevPasses; ++i) {
aurora::gfx::disable_tev_stage(ERglTevStage(i)); aurora::gfx::disable_tev_stage(ERglTevStage(i));
} }
// CGX::SetNumTevStages(sNumEnabledPasses); // CGX::SetNumTevStages(sNumEnabledPasses);