From c0c55c7838ae505c04e90be16da9919b6d49a146 Mon Sep 17 00:00:00 2001 From: Ukn Unknown <4031821+uknunknown@users.noreply.github.com> Date: Mon, 26 May 2025 17:12:06 -0700 Subject: [PATCH] fix memory leak 2 - transcoding fix memory leak 2 - transcoding --- src/transcoding/transcode/hwaccels/vaapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transcoding/transcode/hwaccels/vaapi.c b/src/transcoding/transcode/hwaccels/vaapi.c index bdb9914b9..eb764fb55 100644 --- a/src/transcoding/transcode/hwaccels/vaapi.c +++ b/src/transcoding/transcode/hwaccels/vaapi.c @@ -776,7 +776,6 @@ vaapi_encode_setup_context(AVCodecContext *avctx) if ((ret = av_hwdevice_ctx_create(&self->hw_frame_ref, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0)) < 0) { tvherror(LS_VAAPI, "Encode: Failed to open VAAPI device and create an AVHWDeviceContext for it." "Error code: %s",av_err2str(ret)); - // unref self free(self); self = NULL; return ret; @@ -789,12 +788,13 @@ vaapi_encode_setup_context(AVCodecContext *avctx) // unref hw_frame_ref av_buffer_unref(&self->hw_frame_ref); self->hw_frame_ref = NULL; - // unref self free(self); self = NULL; return ret; } ctx->hw_device_octx = av_buffer_ref(self->hw_frame_ref); + free(self); + self = NULL; #else vaapi_encode_setup_context(AVCodecContext *avctx, int low_power) { -- 2.47.3