aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/exereader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/exereader.cpp')
-rw-r--r--engines/sci/exereader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/exereader.cpp b/engines/sci/exereader.cpp
index 5c069d1304..46a4b2621a 100644
--- a/engines/sci/exereader.cpp
+++ b/engines/sci/exereader.cpp
@@ -236,7 +236,8 @@ void readExe(Common::SeekableReadStream *exeStream, byte *buffer) {
bool isLZEXE = isLZEXECompressed(exeStream);
if (!isLZEXE) {
- exeStream->seek(0, SEEK_SET);
+ // Read the last VERSION_DETECT_BUF_SIZE bytes
+ exeStream->seek(exeStream->size() - VERSION_DETECT_BUF_SIZE, SEEK_SET);
exeStream->read(buffer, VERSION_DETECT_BUF_SIZE);
} else {
// Read the two initial bytes