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

Eugene Sandulenko sev at users.sourceforge.net
Fri Feb 18 16:25:40 CET 2005


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

Modified Files:
	graphics.cpp 
Log Message:
Make cursor code more bulletproof


Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- graphics.cpp	17 Feb 2005 23:00:56 -0000	1.25
+++ graphics.cpp	19 Feb 2005 00:24:48 -0000	1.26
@@ -1057,13 +1057,16 @@
 }
 	
 void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+	if (w == 0 || h == 0)
+		return;
+ 
 	_mouseHotspotX = hotspot_x;
 	_mouseHotspotY = hotspot_y;
 
 	_mouseKeyColor = keycolor;
 
  	_cursorTargetScale = cursorTargetScale;
- 
+
  	if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) {
  		_mouseCurState.w = w;
  		_mouseCurState.h = h;
@@ -1099,7 +1102,7 @@
 	byte color;
 	int w, h;
   
-	if (!_mouseOrigSurface)
+	if (!_mouseOrigSurface || !_mouseData)
  		return;
   
 	w = _mouseCurState.w;





More information about the Scummvm-git-logs mailing list