[Scummvm-cvs-logs] scummvm master -> 0d6b80adb7748e61f79a8a632d9c98b2aeb20d95

bluegr bluegr at gmail.com
Mon Nov 18 21:36:38 CET 2013


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:
0d6b80adb7 TSAGE: Don't assert in PlayStream::getFileOffset() when no data exists


Commit: 0d6b80adb7748e61f79a8a632d9c98b2aeb20d95
    https://github.com/scummvm/scummvm/commit/0d6b80adb7748e61f79a8a632d9c98b2aeb20d95
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-11-18T12:35:48-08:00

Commit Message:
TSAGE: Don't assert in PlayStream::getFileOffset() when no data exists

This function returns 0 when no valid voice data is found, at the place
where it's used. This prevents the game asserting during the intro, when
no speech file is present, in platforms with limited disk space

Changed paths:
    engines/tsage/sound.cpp



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index c8ad8c1..e2fe21c 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -2670,7 +2670,9 @@ void PlayStream::dispatch() {
 }
 
 uint32 PlayStream::getFileOffset(const uint16 *data, int count, int voiceNum) {
-	assert(data);
+	if (!data)
+		return 0;	// no valid voice data found
+
 	int bitsIndex = voiceNum & 7;
 	int byteIndex = voiceNum >> 3;
 	int shiftAmount = bitsIndex * 2;






More information about the Scummvm-git-logs mailing list