rust-av / dav1d-rs

libdav1d rust bindings
MIT License
37 stars 16 forks source link

Make sure the buffer passed to `decode()` is kept alive for as long a… #56

Closed sdroege closed 2 years ago

sdroege commented 2 years ago

…s needed

The decoder might keep it around after send_data() has returned so it must be 'static, and the decoder offers passing a function pointer that can be used to free the data once it is not needed anymore so make use of that for actually freeing the data at that point.

Previously this could've easily caused use-after free if the decoder introduced a frame delay.


CC @philn @aeikum

sdroege commented 2 years ago

Absoleted by https://github.com/rust-av/dav1d-rs/pull/57