History

avfilter/af_surround: Fix memleaks upon allocation error

Andreas Rheinhardt committed 5 years ago

Commit 0429d8e1 parent cd1aaec1 file · +2 −2Browse files

Unified · Split

libavfilter/af_surround.c+2−2
@@ -200,13 +200,13 @@ static int config_input(AVFilterLink *inlink) · 199 unmodified lines
200200 s->rdft = av_calloc(inlink->channels, sizeof(*s->rdft));
201201 if (!s->rdft)
202202 return AVERROR(ENOMEM);
203+ s->nb_in_channels = inlink->channels;
203204
204205 for (ch = 0; ch < inlink->channels; ch++) {
205206 s->rdft[ch] = av_rdft_init(ff_log2(s->buf_size), DFT_R2C);
206207 if (!s->rdft[ch])
207208 return AVERROR(ENOMEM);
208209 }
209− s->nb_in_channels = inlink->channels;
210210 s->input_levels = av_malloc_array(s->nb_in_channels, sizeof(*s->input_levels));
211211 if (!s->input_levels)
212212 return AVERROR(ENOMEM);
@@ -263,13 +263,13 @@ static int config_output(AVFilterLink *outlink) · 50 unmodified lines
263263 s->irdft = av_calloc(outlink->channels, sizeof(*s->irdft));
264264 if (!s->irdft)
265265 return AVERROR(ENOMEM);
266+ s->nb_out_channels = outlink->channels;
266267
267268 for (ch = 0; ch < outlink->channels; ch++) {
268269 s->irdft[ch] = av_rdft_init(ff_log2(s->buf_size), IDFT_C2R);
269270 if (!s->irdft[ch])
270271 return AVERROR(ENOMEM);
271272 }
272− s->nb_out_channels = outlink->channels;
273273 s->output_levels = av_malloc_array(s->nb_out_channels, sizeof(*s->output_levels));
274274 if (!s->output_levels)
275275 return AVERROR(ENOMEM);

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