From 773579091fa175771a2da37b0198c89b33cef73c Mon Sep 17 00:00:00 2001 From: Kara Monk Date: Sat, 21 Nov 2026 13:04:12 -0800 Subject: [PATCH] Initialise m_autoGain in the MBEDecoder constructor m_autoGain was left uninitialised, so a decoder allocated in reused heap memory could take the auto-gain path in decode() and come out about six times too loud. Start it as false, matching the fixed gain (m_gainAdjust) that decoders get when the memory happens to be zero. Fixes #2 --- vocoder/MBEDecoder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vocoder/MBEDecoder.cpp b/vocoder/MBEDecoder.cpp index cc5c8f0..77a9774 100644 --- a/vocoder/MBEDecoder.cpp +++ b/vocoder/MBEDecoder.cpp @@ -73,7 +73,8 @@ namespace vocoder { MBEDecoder::MBEDecoder(MBE_DECODER_MODE mode) : m_mbelibParms(NULL), m_mbeMode(mode), - m_gainAdjust(1.0f) + m_gainAdjust(1.0f), + m_autoGain(false) { m_mbelibParms = new mbelibParms(); mbe_initMbeParms(m_mbelibParms->m_cur_mp, m_mbelibParms->m_prev_mp, m_mbelibParms->m_prev_mp_enhanced);