[Scummvm-cvs-logs] SF.net SVN: scummvm:[51311] scummvm/trunk/engines/agi

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Jul 26 16:22:00 CEST 2010


Revision: 51311
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51311&view=rev
Author:   sev
Date:     2010-07-26 14:21:59 +0000 (Mon, 26 Jul 2010)

Log Message:
-----------
AGI: Fix crash on exit thanks to valgrind

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/sprite.cpp
    scummvm/trunk/engines/agi/view.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2010-07-26 14:21:18 UTC (rev 51310)
+++ scummvm/trunk/engines/agi/agi.cpp	2010-07-26 14:21:59 UTC (rev 51311)
@@ -343,7 +343,7 @@
 
 	// clear view table
 	for (i = 0; i < MAX_VIEWTABLE; i++)
-		memset(&_game.viewTable[i], 0, sizeof(VtEntry));
+		memset(&_game.viewTable[i], 0, sizeof(struct VtEntry));
 
 	initWords();
 

Modified: scummvm/trunk/engines/agi/sprite.cpp
===================================================================
--- scummvm/trunk/engines/agi/sprite.cpp	2010-07-26 14:21:18 UTC (rev 51310)
+++ scummvm/trunk/engines/agi/sprite.cpp	2010-07-26 14:21:59 UTC (rev 51311)
@@ -245,7 +245,7 @@
 	// WORKAROUND (see ScummVM bug #1945716)
 	// When set.view command is called, current code cannot detect  this situation while updating
 	// Thus we force removal of the old sprite
-	if (s->v->viewReplaced) {
+	if (s->v && s->v->viewReplaced) {
 		commitBlock(xPos, yPos, xPos + xSize, yPos + ySize);
 		s->v->viewReplaced = false;
 	}
@@ -679,6 +679,7 @@
 	s.xSize = c->width;
 	s.ySize = c->height;
 	s.buffer = (uint8 *)malloc(s.xSize * s.ySize);
+	s.v = 0;
 
 	objsSaveArea(&s);
 	blitCel(x1, y1, 15, c, _vm->_game.views[n].agi256_2);

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2010-07-26 14:21:18 UTC (rev 51310)
+++ scummvm/trunk/engines/agi/view.cpp	2010-07-26 14:21:59 UTC (rev 51311)
@@ -157,8 +157,7 @@
 		return errNoLoopsInView;
 
 	// allocate memory for all views
-	_game.views[n].loop = (ViewLoop *)
-			calloc(_game.views[n].numLoops, sizeof(ViewLoop));
+	_game.views[n].loop = (ViewLoop *)calloc(_game.views[n].numLoops, sizeof(ViewLoop));
 
 	if (_game.views[n].loop == NULL)
 		return errNotEnoughMemory;


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