-
Notifications
You must be signed in to change notification settings - Fork 2
Assert when input data is too small for RgbaSurface
#34
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
base: main
Are you sure you want to change the base?
Conversation
RgbaSurface
MarijnS95
left a comment
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.
Cool, seems we already checked the output buffer but never the input buffer.
Regarding the clippy lint, we have an fn divide_up_by_multiple() in lib.rs that also seems to open-code div_ceil(), feel free to fix both and unblock the CI.
It is currently possible to trigger UB by reading uninitialized memory using the API. This PR makes sure that the data of the surface given actually is big enough for its height and stride.
633642b to
684ebf3
Compare
|
|
Can you also remove our open-coded
|
I didn't include the change in the PR, so I will fix it. Should I remove |
684ebf3 to
67f8f8e
Compare
|
Yeah I would remove it altogether if it serves no purpose other than wrapping an existing std function. |
67f8f8e to
6651608
Compare
|
Removed all instances of manually implementing |
|
Don't think I can rebase-merge so the resulting commits will be squash-merged :) |
It is currently possible to trigger UB by reading uninitialized memory using the API, which result for example under Windows in a
STATUS_ACCESS_VIOLATION:This PR makes sure that the data of the surface given actually is big enough for its height and stride.