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

GRAPHICS/GUI: Fix various undefined behaviours #3640

Merged
merged 3 commits into from Jan 6, 2022

Conversation

@lephilousophe
Copy link
Member

@lephilousophe lephilousophe commented Jan 3, 2022

These errors were detected with UBSanitizer

Surface::create already initialized memory to 0 and getPixels can be
nullptr if bitmap size is 0. In this case memset gets called with
nullptr which is undefined behaviour.
@lephilousophe lephilousophe requested a review from sev- Jan 3, 2022
graphics/cursorman.cpp Outdated Show resolved Hide resolved
bluegr
bluegr approved these changes Jan 3, 2022
@bluegr
Copy link
Member

@bluegr bluegr commented Jan 3, 2022

Nice work!

@bluegr
Copy link
Member

@bluegr bluegr commented Jan 6, 2022

Thanks! Merging

@bluegr bluegr merged commit 0802db2 into scummvm:master Jan 6, 2022
8 checks passed
@lephilousophe lephilousophe deleted the fix-ub branch Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants