Skip to content

Commit 808ad38

Browse files
Merge pull request #478 from evanc577/friend-list-modern-softlock
Fix softlock on modern when selecting "Team" from menu
2 parents 18b763f + 9a39e30 commit 808ad38

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/text_2.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,14 @@ void sub_80089AC(const WindowTemplate *r4, DungeonPos *r5_Str)
11751175
if (r8 > 160)
11761176
r8 = 160;
11771177

1178+
// BUG: The background array is 161 entries long, but this function will potentially write
1179+
// up to index 160 + 12 = 172, overflowing the array.
1180+
#ifdef BUGFIX
1181+
if (r5 > 160 - 12) {
1182+
r5 = 160 - 12;
1183+
}
1184+
#endif
1185+
11781186
for (i = 0; i < 4; i++) {
11791187
s32 id = r5 * 2;
11801188
if (r6[id] == 240 && r6[id + 1] == 240) {

0 commit comments

Comments
 (0)