[Scummvm-cvs-logs] scummvm master -> a010884c9bfb230da1448d2598011dc68e9efb22

bluegr md5 at scummvm.org
Fri May 27 01:34:43 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a010884c9b SCI: Fixed bug #3306417 - "LAURA BOW 2: segmentation fault while talking to Dr. Myklos"


Commit: a010884c9bfb230da1448d2598011dc68e9efb22
    https://github.com/scummvm/scummvm/commit/a010884c9bfb230da1448d2598011dc68e9efb22
Author: md5 (md5 at scummvm.org)
Date: 2011-05-26T16:32:22-07:00

Commit Message:
SCI: Fixed bug #3306417 - "LAURA BOW 2: segmentation fault while talking to Dr. Myklos"

Changed paths:
    engines/sci/engine/kstring.cpp



diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index c3f2b4d..add5b7b 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -66,8 +66,24 @@ reg_t kStrCpy(EngineState *s, int argc, reg_t *argv) {
 			s->_segMan->strncpy(argv[0], argv[1], length);
 		else
 			s->_segMan->memcpy(argv[0], argv[1], -length);
-	} else
+	} else {
+		if (g_sci->getGameId() == GID_LAURABOW2 && g_sci->getLanguage() == Common::DE_DEU &&
+			s->currentRoomNumber() == 360) {
+			// One of the game texts in LB2 German contains loads of spaces in
+			// its end. We trim the text here, otherwise the graphics code will
+			// attempt to draw a very large window (larger than the screen) to
+			// show the text, and crash.
+			// Fixes bug #3306417.
+			SegmentRef src = s->_segMan->dereference(argv[1]);
+			if (src.maxSize == 7992) {	// the problematic resource. Trim it.
+				Common::String text = s->_segMan->getString(argv[1]);
+				text.trim();
+				s->_segMan->strcpy(argv[1], text.c_str());
+			}
+		}
+
 		s->_segMan->strcpy(argv[0], argv[1]);
+	}
 
 	return argv[0];
 }






More information about the Scummvm-git-logs mailing list