GetSelectedSize() needs to check for a valid selection.

- With mouse navigation, there's no guarantee that there even is a
  selected item.
This commit is contained in:
Randy Heit 2013-09-18 21:29:19 -05:00
parent a7a7d5d6b3
commit e3741c8097

View file

@ -348,7 +348,7 @@ void M_InitVideoModesMenu ()
static bool GetSelectedSize (int *width, int *height) static bool GetSelectedSize (int *width, int *height)
{ {
FOptionMenuDescriptor *opt = GetVideoModeMenu(); FOptionMenuDescriptor *opt = GetVideoModeMenu();
if (opt != NULL) if (opt != NULL && (unsigned)opt->mSelectedItem < opt->mItems.Size())
{ {
int line = opt->mSelectedItem; int line = opt->mSelectedItem;
int hsel; int hsel;