mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-04 11:38:19 +00:00
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.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit ca8e5dedc7
)
This commit is contained in:
parent
42d160ac40
commit
f722ddc234
@ -703,6 +703,9 @@ static int query_formats(AVFilterContext *ctx)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO);
|
ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -721,10 +724,6 @@ static int query_formats(AVFilterContext *ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
formats = ff_all_samplerates();
|
formats = ff_all_samplerates();
|
||||||
if (!formats)
|
if (!formats)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
Reference in New Issue
Block a user