The problem is that this method takes a mutable reference to an NV_ENC_CONFIG. However, this is then stored to a pointer. Therefore, the NV_ENC_CONFIG member may disappear at some point while not violating any lifetime constraints.
This effectively means the NV_ENC_CONFIG may contain random data, causing strange, difficult to debug errors. Or no errors at all in some cases.
The method in question is part of
NV_ENC_INITIALIZE_PARAMS
and can be found here: https://docs.rs/nvidia-video-codec-sdk/latest/src/nvidia_video_codec_sdk/safe/builders.rs.html#54-57The problem is that this method takes a mutable reference to an
NV_ENC_CONFIG
. However, this is then stored to a pointer. Therefore, theNV_ENC_CONFIG
member may disappear at some point while not violating any lifetime constraints.This effectively means the
NV_ENC_CONFIG
may contain random data, causing strange, difficult to debug errors. Or no errors at all in some cases.