1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

CameraStabilization: Bad memory error that Sambas caught

This commit is contained in:
James Cotton 2011-08-11 11:02:12 -05:00
parent 0f1fd8f8c1
commit e56dbfdb24

View File

@ -121,7 +121,8 @@ void ConfigCameraStabilizationWidget::applySettings()
// Channel 1 is second entry, so becomes zero // Channel 1 is second entry, so becomes zero
int mixerNum = selectors[i]->currentIndex() - 1; int mixerNum = selectors[i]->currentIndex() - 1;
if ( *mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_DISABLED && if ( mixerNum >= 0 && // Short circuit in case of none
*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_DISABLED &&
(*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_CAMERAROLL + i) ) { (*mixerTypes[mixerNum] != MixerSettings::MIXER1TYPE_CAMERAROLL + i) ) {
// If the mixer channel already to something that isn't what we are // If the mixer channel already to something that isn't what we are
// about to set it to reset to none // about to set it to reset to none