mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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>
(cherry picked from commit bae96fa977
)
This commit is contained in:
parent
fdf7a28b0a
commit
7f7e601e81
@ -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]));
|
||||
|
Loading…
Reference in New Issue
Block a user