[FFmpeg-cvslog] avfilter/af_vibrato: Fix segfault upon allocation error
Andreas Rheinhardt
git at videolan.org
Wed Jan 12 02:50:34 EET 2022
ffmpeg | branch: release/4.4 | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Oct 6 15:36:05 2021 +0200| [7f7e601e818b4b32e56d7f1699de2f94706b1940] | committer: Andreas Rheinhardt
avfilter/af_vibrato: Fix segfault upon allocation error
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
(cherry picked from commit bae96fa9776cf35cdf32f285f2a980b31e63560a)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f7e601e818b4b32e56d7f1699de2f94706b1940
---
libavfilter/af_vibrato.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/af_vibrato.c b/libavfilter/af_vibrato.c
index 5db1f0f6c9..64d6068b39 100644
--- a/libavfilter/af_vibrato.c
+++ b/libavfilter/af_vibrato.c
@@ -157,11 +157,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]));
More information about the ffmpeg-cvslog
mailing list