aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-06 15:36:05 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-07 12:50:01 +0200
commitbae96fa9776cf35cdf32f285f2a980b31e63560a (patch)
tree0fdd04afd95eea0f7a51f378dd6040e57266a73f
parent0429d8eed85674ae19cccab81f7fbb13a4ccc705 (diff)
downloadffmpeg-bae96fa9776cf35cdf32f285f2a980b31e63560a.tar.gz
avfilter/af_vibrato: Fix segfault upon allocation error
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavfilter/af_vibrato.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_vibrato.c b/libavfilter/af_vibrato.c
index c0cbcbf6f2..2cf1364273 100644
--- a/libavfilter/af_vibrato.c
+++ b/libavfilter/af_vibrato.c
@@ -127,11 +127,11 @@ static int config_input(AVFilterLink *inlink)
int c;
AVFilterContext *ctx = inlink->dst;
VibratoContext *s = ctx->priv;
- s->channels = inlink->channels;
s->buf = av_calloc(inlink->channels, sizeof(*s->buf));
if (!s->buf)
return AVERROR(ENOMEM);
+ s->channels = inlink->channels;
s->buf_size = lrint(inlink->sample_rate * 0.005 + 0.5);
for (c = 0; c < s->channels; c++) {
s->buf[c] = av_malloc_array(s->buf_size, sizeof(*s->buf[c]));