History

avfilter/af_vibrato: Fix segfault upon allocation error

Andreas Rheinhardt committed 5 years ago

Commit bae96fa1 parent 0429d8e1 file · +1 −1Browse files

Unified · Split

libavfilter/af_vibrato.c+1−1
@@ -127,11 +127,11 @@ static int config_input(AVFilterLink *inlink) · 126 unmodified lines
127 int c;127 int c;
128 AVFilterContext *ctx = inlink->dst;128 AVFilterContext *ctx = inlink->dst;
129 VibratoContext *s = ctx->priv;129 VibratoContext *s = ctx->priv;
130 s->channels = inlink->channels;
131 130
132 s->buf = av_calloc(inlink->channels, sizeof(*s->buf));131 s->buf = av_calloc(inlink->channels, sizeof(*s->buf));
133 if (!s->buf)132 if (!s->buf)
134 return AVERROR(ENOMEM);133 return AVERROR(ENOMEM);
134 s->channels = inlink->channels;
135 s->buf_size = lrint(inlink->sample_rate * 0.005 + 0.5);135 s->buf_size = lrint(inlink->sample_rate * 0.005 + 0.5);
136 for (c = 0; c < s->channels; c++) {136 for (c = 0; c < s->channels; c++) {
137 s->buf[c] = av_malloc_array(s->buf_size, sizeof(*s->buf[c]));137 s->buf[c] = av_malloc_array(s->buf_size, sizeof(*s->buf[c]));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t