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.
…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