[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.356,2.357

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Oct 3 10:32:15 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14493

Modified Files:
	gfx.cpp 
Log Message:
Fixed bug #1039162 (Sam & Max intro crash) by making drawBox() do nothing
if the box's width or height is zero or less.


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.356
retrieving revision 2.357
diff -u -d -r2.356 -r2.357
--- gfx.cpp	1 Oct 2004 20:40:03 -0000	2.356
+++ gfx.cpp	3 Oct 2004 17:25:24 -0000	2.357
@@ -868,12 +868,19 @@
 	else if (y2 > vs->h)
 		y2 = vs->h;
 	
+	width = x2 - x;
+	height = y2 - y;
+
+	// This will happen in the Sam & Max intro - see bug #1039162 - where
+	// it would trigger an assertion in blit().
+
+	if (width <= 0 || height <= 0)
+		return;
+
 	markRectAsDirty(vs->number, x, x2, y, y2);
 
 	backbuff = vs->getPixels(x, y);
 
-	width = x2 - x;
-	height = y2 - y;
 	if (color == -1) {
 		if (vs->number != kMainVirtScreen)
 			error("can only copy bg to main window");





More information about the Scummvm-git-logs mailing list