We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 18b763f + 9a39e30 commit 808ad38Copy full SHA for 808ad38
1 file changed
src/text_2.c
@@ -1175,6 +1175,14 @@ void sub_80089AC(const WindowTemplate *r4, DungeonPos *r5_Str)
1175
if (r8 > 160)
1176
r8 = 160;
1177
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
+
1186
for (i = 0; i < 4; i++) {
1187
s32 id = r5 * 2;
1188
if (r6[id] == 240 && r6[id + 1] == 240) {
0 commit comments