Fix UB in HUD_ShieldGaugeBars_Draw
Some checks are pending
Build / Build repo (push) Waiting to run
Check Format / Check format (push) Waiting to run

This commit is contained in:
Alejandro Javier Asenjo Nitti 2024-11-18 03:48:32 -03:00
parent 561f6a76d9
commit db352e70f7
2 changed files with 6 additions and 1 deletions

View File

@ -267,8 +267,13 @@ void HUD_ShieldGaugeFrame_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {
}
void HUD_ShieldGaugeBars_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale, f32 arg4) {
#ifdef AVOID_UB
TextureRect_CI8_2(&gMasterDisp, aShieldGaugeTex, aShieldGaugeTLUT, 48, 8, xPos, yPos, xScale, yScale, 48.0f * arg4,
8.0f);
#else
TextureRect_CI8_2(&gMasterDisp, aShieldGaugeTex, aShieldGaugeTLUT, 48, 12, xPos, yPos, xScale, yScale, 48.0f * arg4,
8.0f);
#endif
}
void HUD_BoostGaugeFrame_Draw(f32 xPos, f32 yPos, f32 xScale, f32 yScale) {

View File

@ -3273,7 +3273,7 @@ void Zoness_801986FC(ZoSarumarine* this, s32 arg1, f32 xOff, f32 yOff, f32 zOff,
#ifndef AVOID_UB
// @Bug: checking out of bounds
// If this passes the boss kills himself.
// If this passes the boss kills himself, since gActors[60] overflows to gBosses[0].
if (i >= ARRAY_COUNT(gActors)) {
actor245->obj.status = OBJ_FREE;
}