aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-08 21:32:04 +0000
committerWillem Jan Palenstijn2009-10-08 21:32:04 +0000
commit2f1c7f779a1facc88188d399574d4aeb8cf6dea5 (patch)
treee3a70c4a9dc908b336e5c35bdcbd7207902238ec
parent76996301d1988f2c6b2659e11223c3016c1232bc (diff)
downloadscummvm-rg350-2f1c7f779a1facc88188d399574d4aeb8cf6dea5.tar.gz
scummvm-rg350-2f1c7f779a1facc88188d399574d4aeb8cf6dea5.tar.bz2
scummvm-rg350-2f1c7f779a1facc88188d399574d4aeb8cf6dea5.zip
SCI: Don't iterate past end of list
svn-id: r44804
-rw-r--r--engines/sci/gui/gui_windowmgr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/sci/gui/gui_windowmgr.cpp b/engines/sci/gui/gui_windowmgr.cpp
index 5f466c3c13..1f445bdd02 100644
--- a/engines/sci/gui/gui_windowmgr.cpp
+++ b/engines/sci/gui/gui_windowmgr.cpp
@@ -91,8 +91,11 @@ void SciGuiWindowMgr::EndUpdate(GuiWindow *wnd) {
GuiPort *oldPort = _gfx->SetPort(_wmgrPort);
const PortList::iterator end = _windowList.end();
PortList::iterator it = Common::find(_windowList.begin(), end, wnd);
- while (it != end) {
- ++it;
+
+ // wnd has to be in _windowList
+ assert(it != end);
+
+ while (++it != end) {
// FIXME: We also store GuiPort objects in the window list.
// We should add a check that we really only pass windows here...
UpdateWindow((GuiWindow *)*it);