ffmpeg-rs icon indicating copy to clipboard operation
ffmpeg-rs copied to clipboard

Avoid using u32 parameters when they are cast to c_int

Open nullsauce opened this issue 3 years ago • 1 comments
trafficstars

In some instances (ex Parameters.set_width(&mut self, value: u32)) we pass a value as u32 but the value is immediately cast into c_int. Passing u32 values bigger than 2^31 will probably create an unexpected behavior. These parameters should therefore be declared as i32 or the function should be changed to use try_into() and return a result if the former doesn't make sense.

nullsauce avatar Sep 01 '22 12:09 nullsauce

Same thing for any other unsigned integers larger tan i32

nullsauce avatar Oct 12 '22 09:10 nullsauce