From bedebaccc39bdef75fe316ea20e57c6dec5b501e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 5 Aug 2008 13:08:07 +0000 Subject: SCUMM: Don't try to load metadata for slot -1 (i.e. don't try to load metadata if nothing is selected) svn-id: r33639 --- engines/scumm/dialogs.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index e4e2b2b620..e6cbdb12a8 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -364,8 +364,9 @@ void SaveLoadChooser::reflowLayout() { void SaveLoadChooser::updateInfos(bool redraw) { int selItem = _list->getSelected(); - Graphics::Surface *thumb; - thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem); + Graphics::Surface *thumb = 0; + if (selItem >= 0) + thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem); if (thumb) { _gfxWidget->setGfx(thumb); @@ -382,7 +383,7 @@ void SaveLoadChooser::updateInfos(bool redraw) { InfoStuff infos; memset(&infos, 0, sizeof(InfoStuff)); char buffer[32]; - if (_vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) { + if (selItem >= 0 && _vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) { snprintf(buffer, 32, "Date: %.2d.%.2d.%.4d", (infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF, infos.date & 0xFFFF); -- cgit v1.2.3