Fix mixer issue with undefined return in callback and non value initialized variables.

This commit is contained in:
acfloria
2017-10-12 08:37:58 +02:00
committed by Lorenz Meier
parent fdc1a2fd39
commit 9d2da611f6
3 changed files with 4 additions and 1 deletions
+2
View File
@@ -384,6 +384,8 @@ mixer_callback(uintptr_t handle,
uint8_t control_index,
float &control)
{
control = 0.0f;
if (control_group >= PX4IO_CONTROL_GROUPS) {
return -1;
}
+1 -1
View File
@@ -299,7 +299,7 @@ SimpleMixer::mix(float *outputs, unsigned space)
}
for (unsigned i = 0; i < _pinfo->control_count; i++) {
float input;
float input = 0.0f;
_control_cb(_cb_handle,
_pinfo->controls[i].control_group,
+1
View File
@@ -590,6 +590,7 @@ bool MixerTest::mixerTest()
static int
mixer_callback(uintptr_t handle, uint8_t control_group, uint8_t control_index, float &control)
{
control = 0.0f;
if (control_group != 0) {
return -1;
}