1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it

Otherwise, there might be leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-09-18 21:33:27 +02:00
parent 9beba05311
commit e2e3181519

View File

@ -235,6 +235,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
if ((avctx->channels > 0 && avctx->ch_layout.nb_channels != avctx->channels) ||
(avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE ||
avctx->ch_layout.u.mask != avctx->channel_layout))) {
av_channel_layout_uninit(&avctx->ch_layout);
if (avctx->channel_layout) {
av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout);
} else {