History

avfilter/af_headphone: Fix leak of channel layouts list on error

In case the multichannel HRIR mode was enabled, an error could happen between allocating a channel layouts list and attaching it to its target destination. If an error happened, the list would leak. This is fixed by attaching the list to its target directly after its allocation.

Andreas Rheinhardt committed 6 years ago

Commit ca8e5de1 parent 0960da41 file · +3 −4Browse files

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

Unified · Split

libavfilter/af_headphone.c+3−4
@@ -703,6 +703,9 @@ static int query_formats(AVFilterContext *ctx) · 702 unmodified lines
703703 return ret;
704704
705705 ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO);
706+ if (ret)
707+ return ret;
708+ ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts);
706709 if (ret)
707710 return ret;
708711
@@ -721,10 +724,6 @@ static int query_formats(AVFilterContext *ctx) · 12 unmodified lines
721724 }
722725 }
723726
724− ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts);
725− if (ret)
726− return ret;
727−
728727 formats = ff_all_samplerates();
729728 if (!formats)
730729 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