From 500b3a32df6c82dcc3b32f765713796c6c660f95 Mon Sep 17 00:00:00 2001 From: mchinen Date: Sat, 5 Feb 2011 10:04:29 +0000 Subject: [PATCH] DeviceToolBar.cpp: fix possible index out of bounds case --- src/toolbars/DeviceToolBar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index 8fa0e1fbb..3eb5b2e4e 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -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;