1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-01 14:43:48 +01:00

DeviceToolBar.cpp: fix possible index out of bounds case

This commit is contained in:
mchinen
2011-02-05 10:04:29 +00:00
parent 7a507aca95
commit 500b3a32df

View File

@@ -701,7 +701,8 @@ void DeviceToolBar::FillInputChannels()
newChannels = mInputDeviceSourceMaps[i].numChannels;
if (oldChannels < newChannels && oldChannels >= 1)
newChannels = oldChannels;
mInputChannels->SetSelection(newChannels - 1);
if (newChannels >= 1)
mInputChannels->SetSelection(newChannels - 1);
gPrefs->Write(wxT("/AudioIO/RecordChannels"), newChannels);
mInputChannels->Enable(mInputChannels->GetCount() ? true : false);
index = i;