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

Fix panic caused by improperly aligned read #675

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Fix panic caused by improperly aligned read #675

merged 1 commit into from
Aug 29, 2024

Conversation

timtom-dev
Copy link
Contributor

Under certain circumstances, Vello could attempt an improperly aligned read, which would cause bytemuck to panic.

This uses bytemuck::pod_read_unaligned instead of bytemuck::from_bytes to achieve the same thing without the possibility of a panic.

Under certain circumstances, Vello could attempt an improperly aligned read, which would cause bytemuck to panic.
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

To clarify for future readers, the reason we haven't seen this before is that it only happens with an allocator which doesn't inadvertently over-align, which the default allocators on most platforms do.

@DJMcNab DJMcNab added this pull request to the merge queue Aug 29, 2024
Merged via the queue into linebender:main with commit ede0e47 Aug 29, 2024
17 checks passed
@timtom-dev timtom-dev deleted the patch-1 branch August 29, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants