1.26.3.0: Apply bounds and error checking for the joystick configuration (fixes #434)

This commit is contained in:
tomcw
2017-07-03 21:48:21 +01:00
parent 63359637ec
commit 1c145ff154
7 changed files with 46 additions and 18 deletions
+6 -1
View File
@@ -91,7 +91,12 @@ void CPropertySheetHelper::FillComboBox(HWND window, int controlid, LPCTSTR choi
SendMessage(combowindow, CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)choices);
choices += _tcslen(choices)+1;
}
SendMessage(combowindow, CB_SETCURSEL, currentchoice, 0);
if (SendMessage(combowindow, CB_SETCURSEL, currentchoice, 0) == (LRESULT)-1 && currentchoice != -1)
{
_ASSERT(0);
SendMessage(combowindow, CB_SETCURSEL, 0, 0); // GH#434: Failed to set currentchoice, so select item-0
}
}
void CPropertySheetHelper::SaveComputerType(eApple2Type NewApple2Type)