PR #20507 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20507
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20507.patch


>From 0c93050b46a431475f0af2e3cac7c400d16afc70 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Fri, 12 Sep 2025 20:47:57 +0200
Subject: [PATCH 1/2] swscale/ops_chain: Free correct pointer on error

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libswscale/ops_chain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/ops_chain.c b/libswscale/ops_chain.c
index 80162507b0..ef768b4904 100644
--- a/libswscale/ops_chain.c
+++ b/libswscale/ops_chain.c
@@ -234,7 +234,7 @@ int ff_sws_op_compile_tables(const SwsOpTable *const 
tables[], int num_tables,
     ret = ff_sws_op_chain_append(chain, best->func, best->free, &priv);
     if (ret < 0) {
         if (best->free)
-            best->free(&priv);
+            best->free(priv.ptr);
         return ret;
     }
 
-- 
2.49.1


>From 18555df87e7838b88bc9c583b79fee2d8cb85555 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Fri, 12 Sep 2025 20:55:24 +0200
Subject: [PATCH 2/2] swscale/x86/ops: Fix leak

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libswscale/x86/ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index 3b5a060f64..82a6d233b9 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -206,7 +206,7 @@ static int setup_dither(const SwsOp *op, SwsOpPriv *out)
     DECL_COMMON_PATTERNS(F32, dither##SIZE##EXT,                               
 \
         .op    = SWS_OP_DITHER,                                                
 \
         .setup = setup_dither,                                                 
 \
-        .free  = SIZE > 2 ? av_free : NULL,                                    
 \
+        .free  = (1 << SIZE) > 2 ? av_free : NULL,                             
 \
         .dither_size = SIZE,                                                   
 \
     );
 
-- 
2.49.1

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

Reply via email to