Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: ddennedy via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: ddennedy <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] scale_d3d11: Fix hw_frame_ctx reference leak (PR #21182)
Date: Fri, 12 Dec 2025 20:19:25 -0000
Message-ID: <176557076647.39.5457309562540955534@2cb04c0e5124> (raw)

PR #21182 opened by ddennedy
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21182
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21182.patch

This fixes #20995. The reference is taken twice and assigned to the same pointer (see above in the same function). Only the latter is needed.

Please consider to pick this into the release/8.0 branch.



>From ad511e919e1dfc194a4e1125f50a24620df0effd Mon Sep 17 00:00:00 2001
From: Dan Dennedy <dan@dennedy.org>
Date: Fri, 12 Dec 2025 11:08:32 -0800
Subject: [PATCH] scale_d3d11: Fix hw_frame_ctx reference leak

This fixes #20995. The reference is taken twice and assigned to the same pointer (see above in the same function). Only the latter is needed.
---
 libavfilter/vf_scale_d3d11.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/vf_scale_d3d11.c b/libavfilter/vf_scale_d3d11.c
index c301f4a0c9..093705c2ea 100644
--- a/libavfilter/vf_scale_d3d11.c
+++ b/libavfilter/vf_scale_d3d11.c
@@ -340,13 +340,6 @@ static int scale_d3d11_config_props(AVFilterLink *outlink)
         return AVERROR(EINVAL);
     }
 
-    ///< Propagate hw_frames_ctx to output
-    outl->hw_frames_ctx = av_buffer_ref(inl->hw_frames_ctx);
-    if (!outl->hw_frames_ctx) {
-        av_log(ctx, AV_LOG_ERROR, "Failed to propagate hw_frames_ctx to output\n");
-        return AVERROR(ENOMEM);
-    }
-
     ///< Initialize filter's hardware device context
     if (!s->hw_device_ctx) {
         AVHWFramesContext *in_frames_ctx = (AVHWFramesContext *)inl->hw_frames_ctx->data;
@@ -394,6 +387,7 @@ static int scale_d3d11_config_props(AVFilterLink *outlink)
         return ret;
     }
 
+    ///< Propagate hw_frames_ctx to output
     outl->hw_frames_ctx = av_buffer_ref(s->hw_frames_ctx_out);
     if (!outl->hw_frames_ctx)
         return AVERROR(ENOMEM);
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-12-12 20:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176557076647.39.5457309562540955534@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git