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

unhandled overflow in validate_texture_copy_range #2962

Closed
jimblandy opened this issue Aug 13, 2022 · 0 comments · Fixed by #2963
Closed

unhandled overflow in validate_texture_copy_range #2962

jimblandy opened this issue Aug 13, 2022 · 0 comments · Fixed by #2963
Labels
area: validation Issues related to validation, diagnostics, and error handling

Comments

@jimblandy
Copy link
Member

wgpu_core::command::transfer::validate_texture_copy_range checks that each axis of the orthotope being copied falls within the texture's boundaries with code like this:

let x_copy_max = texture_copy_view.origin.x + copy_size.width;
if x_copy_max > extent.width {
    return Err(...)
}

If the sum of texture_copy_view.origin.x and copy_size.width overflow in a release build, their sum may fall within extent.width even though the actual range is bad.

@jimblandy jimblandy added the area: validation Issues related to validation, diagnostics, and error handling label Aug 13, 2022
jimblandy added a commit to jimblandy/wgpu that referenced this issue Aug 13, 2022
jimblandy added a commit to jimblandy/wgpu that referenced this issue Aug 14, 2022
jimblandy added a commit to jimblandy/wgpu that referenced this issue Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant