Skip to content

Commit

Permalink
fn cdef::Fn::call: Use .wrapping_as_ptr for bottom to avoid out…
Browse files Browse the repository at this point in the history
…-of-bounds, as the ptr is temporarily out of bounds when passed to asm.
  • Loading branch information
kkysen committed Aug 28, 2024
1 parent c3d2919 commit e541a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl cdef::Fn {
let stride = dst.stride();
let left = ptr::from_ref(left).cast();
let top_ptr = top.as_ptr::<BD>().cast();
let bottom_ptr = bottom.as_ptr::<BD>().cast();
let bottom_ptr = bottom.wrapping_as_ptr::<BD>().cast();
let top = FFISafe::new(&top);
let bottom = FFISafe::new(&bottom);
let sec_strength = sec_strength as c_int;
Expand Down

0 comments on commit e541a11

Please sign in to comment.