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

Safety critical bounds checking is off-by-one in sgrproj_box_ab_internal #3168

Merged
merged 1 commit into from
Apr 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ pub(crate) mod rust {
let n: usize = d * d;
let one_over_n = if r == 1 { 455 } else { 164 };

assert!(iimg.len() > (y + d) * iimg_stride + stripe_w + d);
assert!(iimg_sq.len() > (y + d) * iimg_stride + stripe_w + d);
assert!(af.len() > stripe_w);
assert!(bf.len() > stripe_w);
assert!(iimg.len() > (y + d) * iimg_stride + stripe_w + 1 + d);
assert!(iimg_sq.len() > (y + d) * iimg_stride + stripe_w + 1 + d);
assert!(af.len() > stripe_w + 1);
assert!(bf.len() > stripe_w + 1);

for x in start_x..stripe_w + 2 {
// SAFETY: We perform the bounds checks above, once for the whole loop
Expand Down