aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-17 20:46:36 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-20 14:15:23 +0200
commit62929f40ee7ce1eb2c4b178b98557b7c73f8bc47 (patch)
treef5847fd286bf2666628f0c7857657a084baf505e
parentb50c5d02900363c17560cf79e2af0ca3073ee81a (diff)
downloadffmpeg-62929f40ee7ce1eb2c4b178b98557b7c73f8bc47.tar.gz
fftools/ffmpeg_filter: Fix leak on error
Do this by attaching the FilterGraph directly to more permanent storage from which it will be automatically freed. Fixes Coverity issue #1596533. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--fftools/ffmpeg_filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 382d0f75b1..12cca684b4 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1198,10 +1198,10 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
FilterGraphPriv *fgp;
int ret;
- ret = fg_create(&fg, graph_desc, sch);
+ ret = fg_create(&ost->fg_simple, graph_desc, sch);
if (ret < 0)
return ret;
- ost->fg_simple = fg;
+ fg = ost->fg_simple;
fgp = fgp_from_fg(fg);
fgp->is_simple = 1;