This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit ecf96d120de465dd91b393db4ff4e6e106547248
Author:     Qingzheng Li <[email protected]>
AuthorDate: Thu Aug 6 01:22:57 2026 +0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:55:43 2026 +0100

    avfilter/swaprect: free the input frame when an expression fails
    
    Route expression failures through a common cleanup path,
    since filter_frame() owns the input frame until it is forwarded.
    
    Fixes: memory leak
    Signed-off-by: Qingzheng Li <[email protected]>
    (cherry picked from commit d06847c706ce1559c83cadba2fffbb4dd5632293)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavfilter/vf_swaprect.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c
index fe007ee5e7..c56cf6bca0 100644
--- a/libavfilter/vf_swaprect.c
+++ b/libavfilter/vf_swaprect.c
@@ -101,42 +101,42 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     ret = av_expr_parse_and_eval(&dh, s->h,
                                  var_names, &var_values[0],
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     ret = av_expr_parse_and_eval(&dx1, s->x1,
                                  var_names, &var_values[0],
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     ret = av_expr_parse_and_eval(&dy1, s->y1,
                                  var_names, &var_values[0],
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     ret = av_expr_parse_and_eval(&dx2, s->x2,
                                  var_names, &var_values[0],
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     ret = av_expr_parse_and_eval(&dy2, s->y2,
                                  var_names, &var_values[0],
                                  NULL, NULL, NULL, NULL,
                                  0, 0, ctx);
     if (ret < 0)
-        return ret;
+        goto fail;
 
     w = dw; h = dh; x1[0] = dx1; y1[0] = dy1; x2[0] = dx2; y2[0] = dy2;
 
@@ -194,6 +194,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     return ff_filter_frame(outlink, in);
+
+fail:
+    av_frame_free(&in);
+    return ret;
 }
 
 static int config_input(AVFilterLink *inlink)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to