diff mbox series

[FFmpeg-devel,3/8] avfilter/af_vibrato: Fix segfault upon allocation error

Message ID AM7PR03MB666054AF54852F83731572118FB19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit bae96fa9776cf35cdf32f285f2a980b31e63560a
Headers show
Series [FFmpeg-devel,1/8] avfilter/vf_w3fdif: Fix segfault on allocation error | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 7, 2021, 9:31 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/af_vibrato.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Oct. 7, 2021, 9:35 a.m. UTC | #1
lgtm
diff mbox series

Patch

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]));