issued:attempt to subtract with overflow (#20)

This commit is contained in:
young.day 2024-06-06 11:01:25 +08:00 committed by GitHub
parent 311d49f5b7
commit 4fa1ed5824
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -226,5 +226,5 @@ pub fn descale_mask(mask: DynamicImage, w0: f32, h0: f32, w1: f32, h1: f32) -> D
}
pub fn make_divisible(x: usize, divisor: usize) -> usize {
(x - 1 + divisor) / divisor * divisor
(x + divisor - 1) / divisor * divisor
}