summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-08-04 10:13:46 +0200
committerPaul B Mahol <onemda@gmail.com>2021-08-04 10:13:46 +0200
commit3b298640e1b9565b24a01162ef60742612198fb4 (patch)
tree9ef711f22945b454bcbbd7510f7839b5f43410e1 /libavfilter
parent16b4331bd106e5cb47f8d2dcd098c3dfc022bc34 (diff)
avfilter/af_afftfilt: make sure that tx buffers size are always aligned
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_afftfilt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index 81505f0935..3e69c636c8 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -130,6 +130,7 @@ static int config_input(AVFilterLink *inlink)
float overlap, scale;
char *args;
const char *last_expr = "1";
+ int buf_size;
s->channels = inlink->channels;
s->pts = AV_NOPTS_VALUE;
@@ -142,6 +143,7 @@ static int config_input(AVFilterLink *inlink)
return ret;
s->window_size = s->fft_size;
+ buf_size = FFALIGN(s->window_size, av_cpu_max_align());
s->fft_in = av_calloc(inlink->channels, sizeof(*s->fft_in));
if (!s->fft_in)
@@ -156,15 +158,15 @@ static int config_input(AVFilterLink *inlink)
return AVERROR(ENOMEM);
for (ch = 0; ch < inlink->channels; ch++) {
- s->fft_in[ch] = av_calloc(s->window_size, sizeof(**s->fft_in));
+ s->fft_in[ch] = av_calloc(buf_size, sizeof(**s->fft_in));
if (!s->fft_in[ch])
return AVERROR(ENOMEM);
- s->fft_out[ch] = av_calloc(s->window_size, sizeof(**s->fft_out));
+ s->fft_out[ch] = av_calloc(buf_size, sizeof(**s->fft_out));
if (!s->fft_out[ch])
return AVERROR(ENOMEM);
- s->fft_temp[ch] = av_calloc(s->window_size, sizeof(**s->fft_temp));
+ s->fft_temp[ch] = av_calloc(buf_size, sizeof(**s->fft_temp));
if (!s->fft_temp[ch])
return AVERROR(ENOMEM);
}