image-rs / imageproc

Image processing operations
MIT License
735 stars 145 forks source link

Add `assert!` for image dims in `bilateral_filter` #571

Closed cospectrum closed 4 months ago

cospectrum commented 4 months ago

Someone can create an image with dim > i32::MAX as u32 and dim as i32 will be negative.

cospectrum commented 4 months ago

I checked, there is an assert!(min <= max) in i32::clamp below. But you can still merge, so that readers will understand that this is important.

cospectrum commented 4 months ago

Someday I will write proptests, but not today!

theotherphil commented 4 months ago

Thanks