Skip to content

Commit

Permalink
Merge pull request #1978 from DizzyEggg/windows_overflow
Browse files Browse the repository at this point in the history
Fix HideMapNamePopUpWindow possible overflow
  • Loading branch information
GriffinRichards authored Feb 5, 2024
2 parents 246f47d + e87a69a commit d7a361c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 0 additions & 5 deletions ld_script_modern.ld
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ SECTIONS {
ewram 0x2000000 (NOLOAD) :
ALIGN(4)
{
/*
We link malloc.o here to prevent `gHeap` from landing in the middle of EWRAM.
Otherwise this causes corruption issues on some ld versions
*/
gflib/malloc.o(ewram_data);
src/*.o(ewram_data);
gflib/*.o(ewram_data);
} > EWRAM
Expand Down
9 changes: 7 additions & 2 deletions src/map_name_popup.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,13 @@ void HideMapNamePopUpWindow(void)
{
if (FuncIsActiveTask(Task_MapNamePopUpWindow))
{
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
RemoveMapNamePopUpWindow();
#ifdef UBFIX
if (GetMapNamePopUpWindowId() != WINDOW_NONE)
#endif // UBFIX
{
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
RemoveMapNamePopUpWindow();
}
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0);
DestroyTask(sPopupTaskId);
}
Expand Down

0 comments on commit d7a361c

Please sign in to comment.