Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] swscale/x86/ops: Fix leak (PR #20507)
@ 2025-09-12 19:23 mkver via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2025-09-12 19:23 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: mkver

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 <andreas.rheinhardt@outlook.com>
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 <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 12 Sep 2025 20:55:24 +0200
Subject: [PATCH 2/2] swscale/x86/ops: Fix leak

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-12 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 19:23 [FFmpeg-devel] [PATCH] swscale/x86/ops: Fix leak (PR #20507) mkver via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git