mirror of https://github.com/odrling/Aegisub
Add some bounds checking in the preferences dialog
Originally committed to SVN as r4841.
This commit is contained in:
parent
6a186d0bcb
commit
7a38c1c06e
|
@ -170,7 +170,8 @@ void OptionPage::OptionChoice(wxFlexGridSizer *&flex, const wxString &name, cons
|
|||
|
||||
switch (opt->GetType()) {
|
||||
case agi::OptionValue::Type_Int: {
|
||||
cb->SetValue(choices[opt->GetInt()]);
|
||||
int val = opt->GetInt();
|
||||
cb->SetValue(choices[val < (int)choices.size() ? val : opt->GetDefaultInt()]);
|
||||
cb->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, IntCBUpdater(opt_name, parent));
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue