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.rheinha...@outlook.com>
---
 fftools/ffmpeg_filter.c | 4 ++--
 1 file 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;
-- 
2.40.1

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

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

Reply via email to