Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: softworkz <ffmpegagent@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: softworkz <softworkz@hotmail.com>
Subject: [FFmpeg-devel] [PATCH 4/5] fftools/graphprint: Fix memory leaks
Date: Tue, 20 May 2025 02:05:03 +0000
Message-ID: <c2a9b3b73673e7bfa3667d398d7e1746eecab250.1747706704.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.84.ffstaging.FFmpeg.1747706704.ffmpegagent@gmail.com>

From: softworkz <softworkz@hotmail.com>

- uninit resource manager
- free strings before overwriting
- unref hw_frames_context

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 fftools/graph/graphprint.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fftools/graph/graphprint.c b/fftools/graph/graphprint.c
index 50f1a2ecdc..852a8f6c0c 100644
--- a/fftools/graph/graphprint.c
+++ b/fftools/graph/graphprint.c
@@ -318,6 +318,7 @@ static void print_link(GraphPrintContext *gpc, AVFilterLink *link)
 
     if (hw_frames_ctx && hw_frames_ctx->data)
         print_hwframescontext(gpc, (AVHWFramesContext *)hw_frames_ctx->data);
+    av_buffer_unref(&hw_frames_ctx);
 }
 
 static char sanitize_char(const char c)
@@ -1107,5 +1108,7 @@ cleanup:
 
 int print_filtergraphs(FilterGraph **graphs, int nb_graphs, InputFile **ifiles, int nb_ifiles, OutputFile **ofiles, int nb_ofiles)
 {
-    return print_filtergraphs_priv(graphs, nb_graphs, ifiles, nb_ifiles, ofiles, nb_ofiles);
+    int ret = print_filtergraphs_priv(graphs, nb_graphs, ifiles, nb_ifiles, ofiles, nb_ofiles);
+    ff_resman_uninit();
+    return ret;
 }
-- 
ffmpeg-codebot

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2025-05-20  2:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20  2:04 [FFmpeg-devel] [PATCH 0/5] Graphprint and Mermaid Fixes ffmpegagent
2025-05-20  2:05 ` [FFmpeg-devel] [PATCH 1/5] fftools/makefile: Remove resources from ffprobe softworkz
2025-05-20  2:05 ` [FFmpeg-devel] [PATCH 2/5] fftools/resources: Use .SECONDARY in Makefile comment softworkz
2025-05-20  2:05 ` [FFmpeg-devel] [PATCH 3/5] fftools/ffmpeg: Free print_graph option variables softworkz
2025-05-20  2:05 ` softworkz [this message]
2025-05-20  2:05 ` [FFmpeg-devel] [PATCH 5/5] fftools/tf_mermaid: Add missing uninit and fix leaks softworkz

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=c2a9b3b73673e7bfa3667d398d7e1746eecab250.1747706704.git.ffmpegagent@gmail.com \
    --to=ffmpegagent@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=softworkz@hotmail.com \
    /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