-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Prevent crash on conversion of invalid data in Image
#84782
Conversation
Thank you for your contribution This wouldn't be sufficient, it won't always catch the negative case as the check above is checking for positive values I'd suggest (as I did in the issue report) to check the type, look in After the check for Edit: note also that the check added is in reverse, it requires that the data be empty, the error macros checks if the condition is true and if it is the error is thrown |
I'd also suggest adding a test for this invalid use to the unit tests, in file |
6643b4f
to
413d29c
Compare
Thank you for your help and clarification. I think I understand a little better now. Would this suffice for a test case? It seems to catch problems and print a helpful errors when it fails. |
These tests are good but doesn't cover that it safely handles invalid ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an ASAN build to confirm this but the tests pass and the check works otherwise, preventing some spurious errors
Can someone with an ASAN build confirm in addition to the unit tests?
Just some minor style fixes
@rsburke4 Are you around to address the latest style suggestions? 🙃 |
Yes, I will make the adjustment today. Thank you. |
2506597
to
ddc8443
Compare
Image
Image
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.2.2. |
Cherry-picked for 4.1.4. |
Added error to address #84750
Bugsquad edit:
Image.convert
function crashes Godot #84750