aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/music.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 77c44a3aa6..e30ba96bb7 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -285,7 +285,9 @@ bool MusicHandle::playPSX(uint16 id, bool loop) {
tableFile.close();
- if ((size != 0) && (size != 0xffffffff) && ((offset + size) <= _file.size())) {
+ // Because of broken tunes.dat/tab in psx demo, also check that tune offset is
+ // not over file size
+ if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) {
_file.seek(offset, SEEK_SET);
_audioSource = new Audio::VagStream(_file.readStream(size), loop);
fadeUp();