Re:Porting C to Rust for a Fast and Safe AV1 Media Decoder
by kkysen on Tuesday September 10, 2024 @03:43AM
(#41498221)
I don't think we do either of those errors. Obviously if the C caller does weird stuff, all bets are off, but we don't mutate through `&T`s or not initialize memory. `MaybeUninit` is only used in a few isolated and carefully checked places. Most of the rest of the buffers are zero initialized, which is usually done for free by the kernel.
For example in a similar translation there was UB here: https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/comm...
And here: https://gitlab.com/sequoia-pgp/sha1collisiondetection/-/comm...
I thought there was a fancier/weirder programming error in that crate but I can't find it right now.