mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-01-12 00:06:51 +08:00
avcodec/qsvdec: fix refcount leak in two-stage QSV init
The temporary hw_frames_ctx created for header parsing was not being fully released, leading to a leak. Explicitly unreference the temporary context after use to resolve the leak. Signed-off-by: hajin-chung <hajinchung1@gmail.com>
This commit is contained in:
@@ -202,6 +202,7 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
|
||||
MFXClose(q->internal_qs.session);
|
||||
q->internal_qs.session = NULL;
|
||||
}
|
||||
av_refstruct_unref(&q->frames_ctx.mids);
|
||||
av_buffer_unref(&q->frames_ctx.hw_frames_ctx);
|
||||
|
||||
q->frames_ctx.hw_frames_ctx = av_buffer_ref(hw_frames_ref);
|
||||
|
||||
Reference in New Issue
Block a user