Commit bae96fa9 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avfilter/af_vibrato: Fix segfault upon allocation error

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 0429d8ee
......@@ -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]));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment