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

Use map contains checks for gui textures #432

Merged
merged 1 commit into from
Feb 11, 2024

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Feb 10, 2024

Indexing against a map for a key that doesn't exist will insert a default object constructed to that map.
The gui texture map was being indexed on lookup for texture IDs, and the texture 0 is generally the main renderer framebuffer texture. This can lead to that texture being displayed into ImGui unexpectedly.

Example of non-existent key returning framebuffer:
image

This adds a proper contains() check before indexing against the map to avoid inserting a default value into the map, and will return nullptr or size 0 in the following functions.

@Kenix3 Kenix3 merged commit 6957048 into Kenix3:main Feb 11, 2024
4 checks passed
@Archez Archez deleted the gui-texture-map-checks branch February 13, 2024 15:56
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.

3 participants