aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorsylvaintv2012-04-27 22:38:04 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commitdc4831d00fcc62af77330295e589b4b7523cd391 (patch)
tree187ce82270ebd3cc6f25e87f1107a3d1204a642a /engines/lilliput
parentb2ac6e06316405881473c78d4a84a6baa8dbcee7 (diff)
downloadscummvm-rg350-dc4831d00fcc62af77330295e589b4b7523cd391.tar.gz
scummvm-rg350-dc4831d00fcc62af77330295e589b4b7523cd391.tar.bz2
scummvm-rg350-dc4831d00fcc62af77330295e589b4b7523cd391.zip
LILLIPUT: Fix stream write
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/stream.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/lilliput/stream.cpp b/engines/lilliput/stream.cpp
index 30c7f145c6..03195dc955 100644
--- a/engines/lilliput/stream.cpp
+++ b/engines/lilliput/stream.cpp
@@ -32,12 +32,12 @@ ScriptStream::~ScriptStream() {
}
void ScriptStream::writeUint16LE(int value, int relativePos) {
- Common::MemoryWriteStream tmpStream = Common::MemoryWriteStream(_orgPtr, size());
- int writePos = pos() + relativePos < size();
- assert((writePos >= 0) && (writePos < size()));
+ int writePos = pos() + relativePos;
+ assert((writePos >= 0) && (writePos + 2 < size()));
- tmpStream.writeSint16LE(value);
+ Common::MemoryWriteStream tmpStream = Common::MemoryWriteStream(_orgPtr + writePos, size() - writePos);
+ tmpStream.writeUint16LE(value);
}
} // End of namespace Lilliput