From 82bac3ad22a96eb0a7b7df4d9e4facc979253f08 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 30 Jan 2011 11:20:08 +0000 Subject: [PATCH] - fixed: Actions in the saee menu need to do full range checks for the number of currently selected item. SVN r3126 (trunk) --- src/menu/loadsavemenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index bdc5c3c30..ce4ed4edf 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -753,7 +753,7 @@ bool DLoadSaveMenu::MenuEvent (int mkey, bool fromcontroller) case MKEY_MBYes: { - if (Selected != -1) + if (Selected != -1 && Selected < SaveGames.Size()) { int listindex = SaveGames[0]->bNoDelete? Selected-1 : Selected; remove (SaveGames[Selected]->Filename.GetChars()); @@ -819,7 +819,7 @@ bool DLoadSaveMenu::Responder (event_t *ev) { if (ev->subtype == EV_GUI_KeyDown) { - if (Selected != -1) + if (Selected != -1 && Selected < SaveGames.Size()) { switch (ev->data1) {