aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-09-18 15:50:04 +0200
committerJaromir Wysoglad2019-09-18 16:05:16 +0200
commit4c3f2c30aff6f4d71e673cce134cb4e9742a6cb0 (patch)
treec3984f0900a7e6f4fd7f26853dac7b48b2ef5200
parent00728b94e38ffc64a4f0e0c95878cd747d320764 (diff)
downloadscummvm-rg350-4c3f2c30aff6f4d71e673cce134cb4e9742a6cb0.tar.gz
scummvm-rg350-4c3f2c30aff6f4d71e673cce134cb4e9742a6cb0.tar.bz2
scummvm-rg350-4c3f2c30aff6f4d71e673cce134cb4e9742a6cb0.zip
SUPERNOVA: Fix reading of .dat file
When searching for the right block in supernova.dat, the engine didn't take into account the full size of each block (it thought, it read 12 bytes less in each block) and thanks to that it tryed to read one additional block at the end.
-rw-r--r--engines/supernova/supernova.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 41f05edb7e..e23251c2f3 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -501,7 +501,8 @@ Common::SeekableReadStream *SupernovaEngine::getBlockFromDatFile(Common::String
return f.readStream(size);
} else {
f.skip(size);
- readSize += size;
+ // size + 4 bytes for id + 4 bytes for lang + 4 bytes for size
+ readSize += size + 12;
}
}