avfilter/buffersrc: uninitialize the context ch_layout before overwritting it

av_buffersrc_parameters_set() can be called to set paramenters after the filter
was initialized with for example avfilter_graph_create_filter().

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2022-03-22 18:30:41 -03:00
parent c2d1597a8a
commit 4a8f932fd9
1 changed files with 1 additions and 0 deletions

View File

@ -132,6 +132,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
// if the old/new fields are set inconsistently, prefer the old ones
if (param->channel_layout && (param->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
param->ch_layout.u.mask != param->channel_layout)) {
av_channel_layout_uninit(&s->ch_layout);
av_channel_layout_from_mask(&s->ch_layout, param->channel_layout);
FF_ENABLE_DEPRECATION_WARNINGS
} else