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
703 return ret;703 return ret;
704 704
705 ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO);705 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);
706 if (ret)709 if (ret)
707 return ret;710 return ret;
708 711
@@ -721,10 +724,6 @@ static int query_formats(AVFilterContext *ctx) · 12 unmodified lines
721 }724 }
722 }725 }
723 726
724 ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts);
725 if (ret)
726 return ret;
727
728 formats = ff_all_samplerates();727 formats = ff_all_samplerates();
729 if (!formats)728 if (!formats)
730 return AVERROR(ENOMEM);729 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