When qsv device is created by device_derive, the ctx->free function is not registered, causing potential memory leak because of not properly closing the MFX session.
Signed-off-by: Tong Wu <tong1...@intel.com> Signed-off-by: Wenbin Chen <wenbin.c...@intel.com> --- libavutil/hwcontext_qsv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 4ed4242ddf..713dc90ffd 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -2094,6 +2094,9 @@ static int qsv_device_derive(AVHWDeviceContext *ctx, AVDictionary *opts, int flags) { mfxIMPL impl; + + ctx->free = qsv_device_free; + impl = choose_implementation("hw_any", child_device_ctx->type); return qsv_device_derive_from_child(ctx, impl, child_device_ctx, flags); -- 2.41.0.windows.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".