Skip to content

Commit e87a69a

Browse files
committed
Fix HideMapNamePopUpWindow possible overflow
1 parent 5be69b2 commit e87a69a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ld_script_modern.ld

-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ SECTIONS {
1515
ewram 0x2000000 (NOLOAD) :
1616
ALIGN(4)
1717
{
18-
/*
19-
We link malloc.o here to prevent `gHeap` from landing in the middle of EWRAM.
20-
Otherwise this causes corruption issues on some ld versions
21-
*/
22-
gflib/malloc.o(ewram_data);
2318
src/*.o(ewram_data);
2419
gflib/*.o(ewram_data);
2520
} > EWRAM

src/map_name_popup.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,13 @@ void HideMapNamePopUpWindow(void)
317317
{
318318
if (FuncIsActiveTask(Task_MapNamePopUpWindow))
319319
{
320-
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
321-
RemoveMapNamePopUpWindow();
320+
#ifdef UBFIX
321+
if (GetMapNamePopUpWindowId() != WINDOW_NONE)
322+
#endif // UBFIX
323+
{
324+
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
325+
RemoveMapNamePopUpWindow();
326+
}
322327
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0);
323328
DestroyTask(sPopupTaskId);
324329
}

0 commit comments

Comments
 (0)