aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-02-09 15:49:09 +0100
committerPaul B Mahol <onemda@gmail.com>2020-02-09 15:49:09 +0100
commit53a485cd374edff1f0701310af47bf0fd3dd3c0e (patch)
treea6e490990bb92dacbd6007e351021b5f631f8bac
parent2174a315b46815ceb9ca9150650078b22ba0ad84 (diff)
downloadffmpeg-53a485cd374edff1f0701310af47bf0fd3dd3c0e.tar.gz
avfilter/af_afftfilt: fix memory leaks on error
-rw-r--r--libavfilter/af_afftfilt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index a14dd280e0..a6156bf852 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -40,6 +40,7 @@ typedef struct AFFTFiltContext {
FFTComplex **fft_data;
FFTComplex **fft_temp;
int nb_exprs;
+ int channels;
int window_size;
AVExpr **real;
AVExpr **imag;
@@ -129,6 +130,7 @@ static int config_input(AVFilterLink *inlink)
char *args;
const char *last_expr = "1";
+ s->channels = inlink->channels;
s->pts = AV_NOPTS_VALUE;
s->fft_bits = av_log2(s->fft_size);
s->fft = av_fft_init(s->fft_bits, 0);
@@ -435,7 +437,7 @@ static av_cold void uninit(AVFilterContext *ctx)
av_fft_end(s->fft);
av_fft_end(s->ifft);
- for (i = 0; i < s->nb_exprs; i++) {
+ for (i = 0; i < s->channels; i++) {
if (s->fft_data)
av_freep(&s->fft_data[i]);
if (s->fft_temp)