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

[rcore] fix crash in InitWindow, due to unchecked result of InitPlatform #4803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sleeptightAnsiC
Copy link
Contributor

Check the result of InitPlatform(), if it isn't 0, report the Error and return. This prevent crashes and allows for gracefully aborting or recovering by checking IsWindowReady().

I decided to use LOG_ERROR here, because this is a fatal error in most cases, and it will cause a crash when ignored. However, I'm not so sure about SYSTEM prefix. There was no good choice for it. It must be very generic because InitPlatform() can fail in multiple cases.

Tested on native x86_64 Linux, and on x86_64 MacOS 13.6.9 running in VM. With GLFW in both cases.

Partially-fixes: #4801

Check the result of InitPlatform(), if it isn't 0, report the Error
and return. This prevent crashes and allows for gracefully aborting
or recovering by checking IsWindowReady().

Partially-fixes: raysan5#4801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant