Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HideMapNamePopUpWindow possible overflow #1978

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

DizzyEggg
Copy link
Contributor

Followup to #1976

We found the cause of the glitching map graphics. It was GetMapNamePopUpWindowId passing 0xFF as valid windowId, which in turn modifies the data directly below gWindows, which happened to be gHeap on some compiler/linker versions. In vanilla this goes unnoticed.

@GriffinRichards
Copy link
Member

It's too bad they didn't have a single point of reference for gWindows, it'd be nice to do this kind of check there (because I wouldn't be surprised if there are some other places this is happening quietly). But by my count there's 23 functions that access gWindows with an arbitrary window id, so this is definitely the less intrusive fix.

@GriffinRichards GriffinRichards merged commit d7a361c into pret:master Feb 5, 2024
1 check passed
@DizzyEggg DizzyEggg deleted the windows_overflow branch March 6, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants