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 59a5090070 avfilter/af_adeclick: free transform contexts and buffers
on error
59a5090070 is described below
commit 59a5090070d094029cc328f6160b87a9f214c01d
Author: Michael Niedermayer <[email protected]>
AuthorDate: Mon Jun 29 01:35:05 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Tue Jun 30 11:05:29 2026 +0000
avfilter/af_adeclick: free transform contexts and buffers on error
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <[email protected]>
---
libavfilter/af_adeclick.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c
index 043435b186..198e7fab63 100644
--- a/libavfilter/af_adeclick.c
+++ b/libavfilter/af_adeclick.c
@@ -130,8 +130,8 @@ static int config_input(AVFilterLink *inlink)
return AVERROR(ENOMEM);
{
- double *tx_in[2], *tx_out[2];
- AVTXContext *tx, *itx;
+ double *tx_in[2] = { NULL }, *tx_out[2] = { NULL };
+ AVTXContext *tx = NULL, *itx = NULL;
av_tx_fn tx_fn, itx_fn;
int ret, tx_size;
double scale;
@@ -141,19 +141,21 @@ static int config_input(AVFilterLink *inlink)
scale = 1.0;
ret = av_tx_init(&tx, &tx_fn, AV_TX_DOUBLE_RDFT, 0, tx_size, &scale,
0);
if (ret < 0)
- return ret;
+ goto tx_end;
scale = 1.0 / tx_size;
ret = av_tx_init(&itx, &itx_fn, AV_TX_DOUBLE_RDFT, 1, tx_size, &scale,
0);
if (ret < 0)
- return ret;
+ goto tx_end;
tx_in[0] = av_calloc(tx_size + 2, sizeof(*tx_in[0]));
tx_in[1] = av_calloc(tx_size + 2, sizeof(*tx_in[1]));
tx_out[0] = av_calloc(tx_size + 2, sizeof(*tx_out[0]));
tx_out[1] = av_calloc(tx_size + 2, sizeof(*tx_out[1]));
- if (!tx_in[0] || !tx_in[1] || !tx_out[0] || !tx_out[1])
- return AVERROR(ENOMEM);
+ if (!tx_in[0] || !tx_in[1] || !tx_out[0] || !tx_out[1]) {
+ ret = AVERROR(ENOMEM);
+ goto tx_end;
+ }
for (int n = 0; n < s->window_size - s->hop_size; n++)
tx_in[0][n] = 1.0;
@@ -180,6 +182,7 @@ static int config_input(AVFilterLink *inlink)
for (int n = 0; n < s->window_size; n++)
s->window_func_lut[n] = tx_out[0][n] * scale;
+tx_end:
av_tx_uninit(&tx);
av_tx_uninit(&itx);
@@ -187,6 +190,9 @@ static int config_input(AVFilterLink *inlink)
av_freep(&tx_in[1]);
av_freep(&tx_out[0]);
av_freep(&tx_out[1]);
+
+ if (ret < 0)
+ return ret;
}
av_frame_free(&s->in);
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]