Merge pull request #430 from PCSX2/win-ocl-crash-fix

gsdx ocl: check size of array before access
This commit is contained in:
Gregory Hainaut 2015-01-17 12:05:52 +01:00
commit 0bdeb8d411
1 changed files with 3 additions and 1 deletions

View File

@ -269,7 +269,9 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
if(ComboBoxGetSelData(IDC_OPENCL_DEVICE, data))
{
theApp.SetConfig("ocldev", m_ocl_devs[(int)data].name.c_str());
if ((int)data < m_ocl_devs.size()) {
theApp.SetConfig("ocldev", m_ocl_devs[(int)data].name.c_str());
}
}
if(!m_IsOpen2 && ComboBoxGetSelData(IDC_RESOLUTION, data))