Skip to content
Snippets Groups Projects
Verified Commit 40c3d28a authored by jD91mZM2's avatar jD91mZM2
Browse files

fixup! Fix a few ffmpeg issues

parent b0546336
No related branches found
No related tags found
No related merge requests found
...@@ -728,8 +728,9 @@ pub fn convert_integer(s: *const c_char, base: c_int) -> Option<(c_ulong, isize, ...@@ -728,8 +728,9 @@ pub fn convert_integer(s: *const c_char, base: c_int) -> Option<(c_ulong, isize,
let mut overflowed = false; let mut overflowed = false;
loop { loop {
// `-1 as usize` is -1 // `-1 as usize` is usize::MAX
// `-1 as u8 as usize` is 255 // `-1 as u8 as usize` is u8::MAX
// It extends by the sign bit unless we cast it to unsigned first.
let val = unsafe { LOOKUP_TABLE[*s.offset(idx) as u8 as usize] }; let val = unsafe { LOOKUP_TABLE[*s.offset(idx) as u8 as usize] };
if val == -1 || val as c_int >= base { if val == -1 || val as c_int >= base {
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment