(svn r9437) -Fix (r9420): dedicated server crashed when the y part of the resolution was less than 10.
authorrubidium
Sun, 25 Mar 2007 00:13:22 +0000
changeset 6700 0cee66ecb04a
parent 6699 ff3ea89c64e4
child 6701 d4c3cb84e494
(svn r9437) -Fix (r9420): dedicated server crashed when the y part of the resolution was less than 10.
src/texteff.cpp
--- a/src/texteff.cpp	Sat Mar 24 23:43:33 2007 +0000
+++ b/src/texteff.cpp	Sun Mar 25 00:13:22 2007 +0000
@@ -156,6 +156,7 @@
 		if (x + width >= _screen.width) {
 			width = _screen.width - x;
 		}
+		if (width <= 0 || height <= 0) return;
 
 		_textmessage_visible = false;
 		/* Put our 'shot' back to the screen */
@@ -220,6 +221,8 @@
 	if (x + width >= _screen.width) {
 		width = _screen.width - x;
 	}
+	if (width <= 0 || height <= 0) return;
+
 	/* Make a copy of the screen as it is before painting (for undraw) */
 	memcpy_pitch(
 		_textmessage_backup,