History

avfilter/af_surround: Fix memleaks upon allocation error

Andreas Rheinhardt committed 5 years ago

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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_surround.c+2−2
@@ -200,13 +200,13 @@ static int config_input(AVFilterLink *inlink) · 199 unmodified lines
200 s->rdft = av_calloc(inlink->channels, sizeof(*s->rdft));200 s->rdft = av_calloc(inlink->channels, sizeof(*s->rdft));
201 if (!s->rdft)201 if (!s->rdft)
202 return AVERROR(ENOMEM);202 return AVERROR(ENOMEM);
203 s->nb_in_channels = inlink->channels;
203 204
204 for (ch = 0; ch < inlink->channels; ch++) {205 for (ch = 0; ch < inlink->channels; ch++) {
205 s->rdft[ch] = av_rdft_init(ff_log2(s->buf_size), DFT_R2C);206 s->rdft[ch] = av_rdft_init(ff_log2(s->buf_size), DFT_R2C);
206 if (!s->rdft[ch])207 if (!s->rdft[ch])
207 return AVERROR(ENOMEM);208 return AVERROR(ENOMEM);
208 }209 }
209 s->nb_in_channels = inlink->channels;
210 s->input_levels = av_malloc_array(s->nb_in_channels, sizeof(*s->input_levels));210 s->input_levels = av_malloc_array(s->nb_in_channels, sizeof(*s->input_levels));
211 if (!s->input_levels)211 if (!s->input_levels)
212 return AVERROR(ENOMEM);212 return AVERROR(ENOMEM);
@@ -263,13 +263,13 @@ static int config_output(AVFilterLink *outlink) · 50 unmodified lines
263 s->irdft = av_calloc(outlink->channels, sizeof(*s->irdft));263 s->irdft = av_calloc(outlink->channels, sizeof(*s->irdft));
264 if (!s->irdft)264 if (!s->irdft)
265 return AVERROR(ENOMEM);265 return AVERROR(ENOMEM);
266 s->nb_out_channels = outlink->channels;
266 267
267 for (ch = 0; ch < outlink->channels; ch++) {268 for (ch = 0; ch < outlink->channels; ch++) {
268 s->irdft[ch] = av_rdft_init(ff_log2(s->buf_size), IDFT_C2R);269 s->irdft[ch] = av_rdft_init(ff_log2(s->buf_size), IDFT_C2R);
269 if (!s->irdft[ch])270 if (!s->irdft[ch])
270 return AVERROR(ENOMEM);271 return AVERROR(ENOMEM);
271 }272 }
272 s->nb_out_channels = outlink->channels;
273 s->output_levels = av_malloc_array(s->nb_out_channels, sizeof(*s->output_levels));273 s->output_levels = av_malloc_array(s->nb_out_channels, sizeof(*s->output_levels));
274 if (!s->output_levels)274 if (!s->output_levels)
275 return AVERROR(ENOMEM);275 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