[Scummvm-cvs-logs] CVS: scummvm/backends/sdl graphics.cpp,1.57,1.58

Max Horn fingolfin at users.sourceforge.net
Tue Nov 8 14:24:21 CET 2005


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15502/backends/sdl

Modified Files:
	graphics.cpp 
Log Message:
Added asserts to OSystem_SDL::copyRectToScreen, which should detect any attempts to use invalid rects for blitting

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- graphics.cpp	7 Nov 2005 08:35:50 -0000	1.57
+++ graphics.cpp	8 Nov 2005 22:23:09 -0000	1.58
@@ -802,6 +802,11 @@
 
 	Common::StackLock lock(_graphicsMutex);	// Lock the mutex until this function ends
 
+	assert(x >= 0 && x < _screenWidth);
+	assert(y >= 0 && y < _screenHeight);
+	assert(h > 0 && y + h <= _screenHeight);
+	assert(w > 0 && x + w <= _screenWidth);
+
 	if (((long)src & 3) == 0 && pitch == _screenWidth && x == 0 && y == 0 &&
 			w == _screenWidth && h == _screenHeight && _modeFlags & DF_WANT_RECT_OPTIM) {
 		/* Special, optimized case for full screen updates.





More information about the Scummvm-git-logs mailing list