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

[3.x] Fix a crash when trying to load a WebP StreamTexture #51014

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

YuriSizov
Copy link
Contributor

Fixes #51003.

Though I am not sure exactly what is going on here. For some reason with the existence of a theme specifically a StreamTexture is attempting to get loaded when it reasonably cannot because, I think, ImageLoaderWEBP hasn't been initialized yet (hence the crash, Image::webp_unpacker points nowhere). I found other places checking for validity of *_unpacker methods, so I added same checks here.

It doesn't crash anymore, and still loads fine, but that only tells me there are some other problems which are hidden. First of all, it's weird to attempt to load a texture so early with a theme. Adding the same texture to a scene doesn't cause that (or I didn't test it properly). Second of all, the checks that I've added should prevent the texture from loading (as we cannot do that at that moment) yet it still loads in the end and there are no visible glitches for the user. So there is probably some redundancy somewhere that attempts to load it again later? Maybe it's not that bad, but it's still troubling.

Either way, the crash is fixed (from my testing) and the texture is loaded fine.

@akien-mga akien-mga merged commit bab9c02 into godotengine:3.x Jul 29, 2021
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor Author

For the reference, the underlying issue should be fixed with #55483.

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.

2 participants