Closed ralfbiedert closed 2 years ago
This does not seem to be related to recent upstream changes. I just rolled back to 0712009
upstream and the error is still happens.
And interestingly enough:
cargo +nightly test --features backtrace
-- workscargo +nightly test
-- failsSomething is really UB broken here:
Gives
[openh264\tests\decode.rs:71] 1 = 1
[openh264\src\decoder.rs:179] 2 = 2
[openh264\src\decoder.rs:188] 3 = 3
[openh264\src\decoder.rs:196] 4 = 4
[openh264\src\decoder.rs:198] "WILL RETURN OK" = "WILL RETURN OK"
[openh264\tests\decode.rs:73] &x = Err(
Error {
native: 0,
decoding_state: 0,
misc: None,
},
)
In other words, Ok
ends up as Err
...
Alright, the error was UB in here, where dst[x]
were null. However, they should not be null, since OpenH264 did not return an error ...
let y = std::slice::from_raw_parts(dst[0], (info.iHeight * info.iStride[0]) as usize);
let u = std::slice::from_raw_parts(dst[1], (info.iHeight * info.iStride[1] / 2) as usize);
let v = std::slice::from_raw_parts(dst[2], (info.iHeight * info.iStride[1] / 2) as usize);
To repeat what has been observed in #18 and others:
2022-08-23
From #18:
I just did some testing on my Linux machine, but the behavior is basically the same, it fails on
+nightly
in hereError: