From: mkver via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: mkver <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] swscale/x86/ops: Fix leak (PR #20507)
Date: Fri, 12 Sep 2025 19:23:39 -0000
Message-ID: <175770502051.25.2773184180907193806@463a07221176> (raw)
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
reply other threads:[~2025-09-12 19:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=175770502051.25.2773184180907193806@463a07221176 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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