From c4e537793b5939262cabb708ff798a732b8aba33 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Wed, 17 Sep 2025 21:31:56 +0200 Subject: [PATCH] avfilter/vsrc_gfxcapture: fix leaking all callback handlers Fixes #20537 --- libavfilter/vsrc_gfxcapture_winrt.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vsrc_gfxcapture_winrt.hpp b/libavfilter/vsrc_gfxcapture_winrt.hpp index a02e768c8f..ba1979b1c1 100644 --- a/libavfilter/vsrc_gfxcapture_winrt.hpp +++ b/libavfilter/vsrc_gfxcapture_winrt.hpp @@ -159,9 +159,9 @@ private: template static Microsoft::WRL::ComPtr create_cb_handler(F&& cb_func) { - return Microsoft::WRL::ComPtr( - new FFTypedCBHandler(std::forward(cb_func)) - ); + Microsoft::WRL::ComPtr res; + res.Attach(new FFTypedCBHandler(std::forward(cb_func))); + return res; } /******************************************