diff options
author | Filippos Karapetis | 2013-11-18 22:35:48 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-11-18 22:35:48 +0200 |
commit | 0d6b80adb7748e61f79a8a632d9c98b2aeb20d95 (patch) | |
tree | a31776974ccbeb785050f20b4b32251bd5a1b08d /engines | |
parent | b7855ed93793e4b41d1abc8eff60c2a8a5f8275f (diff) | |
download | scummvm-rg350-0d6b80adb7748e61f79a8a632d9c98b2aeb20d95.tar.gz scummvm-rg350-0d6b80adb7748e61f79a8a632d9c98b2aeb20d95.tar.bz2 scummvm-rg350-0d6b80adb7748e61f79a8a632d9c98b2aeb20d95.zip |
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
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/sound.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c8ad8c1281..e2fe21c6d7 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; |