fix(radio): invalid memory access if SpaceMouse input present but not supported (#4686)
i.e. somehow the input has been specified but not has not been specified as a option in the firmware
This commit is contained in:
+5
-1
@@ -360,9 +360,13 @@ getvalue_t getValue(mixsrc_t i, bool* valid)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPACEMOUSE)
|
#if defined(PCBHORUS)
|
||||||
else if (i >= MIXSRC_FIRST_SPACEMOUSE && i <= MIXSRC_LAST_SPACEMOUSE) {
|
else if (i >= MIXSRC_FIRST_SPACEMOUSE && i <= MIXSRC_LAST_SPACEMOUSE) {
|
||||||
|
#if defined(SPACEMOUSE)
|
||||||
return get_spacemouse_value(i - MIXSRC_FIRST_SPACEMOUSE);
|
return get_spacemouse_value(i - MIXSRC_FIRST_SPACEMOUSE);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user