diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 352cc110438..77c44a3aa66 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -285,7 +285,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) { tableFile.close(); - if ((size != 0) && (size != 0xffffffff)) { + if ((size != 0) && (size != 0xffffffff) && ((offset + size) <= _file.size())) { _file.seek(offset, SEEK_SET); _audioSource = new Audio::VagStream(_file.readStream(size), loop); fadeUp();