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:
hajin-chung
2025-09-16 17:13:01 +09:00
committed by Zhao Zhili
parent 4bfac71ecd
commit 991ba3fbac

View File

@@ -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);