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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -703,6 +703,9 @@ static int query_formats(AVFilterContext *ctx) · 702 unmodified lines | ||
| 703 | 703 | return ret; |
| 704 | 704 | |
| 705 | 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 | 709 | if (ret) |
| 707 | 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 | 727 | formats = ff_all_samplerates(); |
| 729 | 728 | if (!formats) |
| 730 | 729 | return AVERROR(ENOMEM); |