diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7dba1a69..91828aac 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ lib_xua Change Log ================== +UNRELEASED +---------- + + * FIXED: Memory corruption during initialisation of mixer weights + 3.4.0 ----- diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index 888291f7..a21e605a 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -275,15 +275,10 @@ void InitLocalMixerState() } /* Configure default connections */ - // TODO this should be a loop using defines. - mixer1Weights[0] = 0; - mixer1Weights[9] = 0; - mixer1Weights[18] = 0; - mixer1Weights[27] = 0; - mixer1Weights[36] = 0; - mixer1Weights[45] = 0; - mixer1Weights[54] = 0; - mixer1Weights[63] = 0; + for (int i = 0; i < MAX_MIX_COUNT; i++) + { + mixer1Weights[(i * MAX_MIX_COUNT) + i] = 0; + } #if NUM_USB_CHAN_OUT > 0 /* Setup up audio output channel mapping */