From 13b83b59e78ad4aeb92960bf45dcffdb2c4f3add Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Tue, 23 Aug 2022 11:22:48 +0200 Subject: [PATCH] Ensure the channel layout is never invalid --- decoder/LAVAudio/PostProcessor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/decoder/LAVAudio/PostProcessor.cpp b/decoder/LAVAudio/PostProcessor.cpp index e57399ecf..22fe3669f 100644 --- a/decoder/LAVAudio/PostProcessor.cpp +++ b/decoder/LAVAudio/PostProcessor.cpp @@ -198,6 +198,9 @@ HRESULT ExtendedChannelMapping(BufferDetails *pcm, const unsigned uOutChannels, // Apply changes to buffer delete pcm->bBuffer; pcm->bBuffer = out; + av_channel_layout_uninit(&pcm->layout); + pcm->layout.order = AV_CHANNEL_ORDER_UNSPEC; + pcm->layout.nb_channels = uOutChannels; return S_OK; }