[Scummvm-cvs-logs] SF.net SVN: scummvm:[44804] scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Thu Oct 8 23:32:10 CEST 2009


Revision: 44804
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44804&view=rev
Author:   wjpalenstijn
Date:     2009-10-08 21:32:04 +0000 (Thu, 08 Oct 2009)

Log Message:
-----------
SCI: Don't iterate past end of list

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-08 21:29:45 UTC (rev 44803)
+++ scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp	2009-10-08 21:32:04 UTC (rev 44804)
@@ -91,8 +91,11 @@
 	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);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list