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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 6e37545d6b swscale: fix possible lut leak in adapt_colors()
6e37545d6b is described below

commit 6e37545d6be7fb3bd74a4766eb0712ed443603bb
Author:     Huihui_Huang <[email protected]>
AuthorDate: Tue Mar 17 15:56:15 2026 +0800
Commit:     Huihui_Huang <[email protected]>
CommitDate: Tue Mar 17 15:56:40 2026 +0800

    swscale: fix possible lut leak in adapt_colors()
    
    adapt_colors() allocates a SwsLut3D before calling add_convert_pass(). If 
add_convert_pass() fails, the function returns without freeing the previously 
allocated lut. Free lut on that error path.
    
    Signed-off-by: Huihui_Huang <[email protected]>
---
 libswscale/graph.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index db11591862..3b16037767 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -702,8 +702,10 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, 
SwsFormat dst,
         SwsFormat tmp = src;
         tmp.format = fmt_in;
         ret = add_convert_pass(graph, &src, &tmp, input, &input);
-        if (ret < 0)
+        if (ret < 0) {
+            ff_sws_lut3d_free(&lut);
             return ret;
+        }
     }
 
     ret = ff_sws_lut3d_generate(lut, fmt_in, fmt_out, &map);

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to