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

TileSet Fix crash in AtlasMergingDialog #75361

Merged

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Mar 26, 2023

When generating the merged TileSetAtlasSource the newly calculated new_texture_region_size was being set after creating tiles within such source. Hence during tiles creation its texture_region_size was the default (16, 16) instead of the new_texture_region_size. When any dimension of new_texture_region_size was smaller than 16 then the tile would fail to be created as it would be determined to not fit within the new texture. Hence later obtaining such tile's data would fail (as it was not created) and thus nullptr would be dereferenced when trying to copy the properties (which caused the crash).

This PR makes the new_texture_region_size be set before copying the tiles so the checks should not fail like before.

Fixes #75354.

@YuriSizov YuriSizov requested a review from KoBeWi March 27, 2023 09:44
@kleonc kleonc force-pushed the tile-set-atlas-merging-crash-fix branch from c46fb54 to c72b096 Compare March 28, 2023 18:07
@YuriSizov YuriSizov merged commit 23394be into godotengine:master Mar 28, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@kleonc kleonc deleted the tile-set-atlas-merging-crash-fix branch March 28, 2023 18:47
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.2.

@YuriSizov YuriSizov changed the title TileSet editor AtlasMergingDialog crash fix TileSet Fix crash in AtlasMergingDialog Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Atlas Merge Tool crashes when selecting entries to merge
3 participants