From 70ad09f6ef9928ca2c6d4f67f5fa32b11cd63d8c Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 16 Jan 2015 09:38:23 +0100 Subject: [PATCH] gsdx ocl: check size of array before access Potential fix for issue #408 ? --- plugins/GSdx/GSSettingsDlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index 397fccf582..2aae9b1d82 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -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))