diff options
author | Eugene Sandulenko | 2017-03-22 19:34:09 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-03-22 19:34:09 +0100 |
commit | d84535192ac02351cf5a7a04005aaa6fa097c9bb (patch) | |
tree | dc6e34a44aae8db6ce7f841d4a9702ca00ef18ba | |
parent | a0253001d837c1a937956c6e48bccfd50a07a188 (diff) | |
download | scummvm-rg350-d84535192ac02351cf5a7a04005aaa6fa097c9bb.tar.gz scummvm-rg350-d84535192ac02351cf5a7a04005aaa6fa097c9bb.tar.bz2 scummvm-rg350-d84535192ac02351cf5a7a04005aaa6fa097c9bb.zip |
DIRECTOR: Fix data sizes when reading from archives
-rw-r--r-- | engines/director/score.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 609c8abc7c..4b65044baa 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -629,15 +629,15 @@ void Score::setCastMemberModified(int castId) { void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) { _labels = new Common::SortedArray<Label *>(compareLabels); uint16 count = stream.readUint16() + 1; - uint16 offset = count * 4 + 2; + uint32 offset = count * 4 + 2; uint16 frame = stream.readUint16(); - uint16 stringPos = stream.readUint16() + offset; + uint32 stringPos = stream.readUint16() + offset; for (uint16 i = 0; i < count; i++) { uint16 nextFrame = stream.readUint16(); - uint16 nextStringPos = stream.readUint16() + offset; - uint16 streamPos = stream.pos(); + uint32 nextStringPos = stream.readUint16() + offset; + uint32 streamPos = stream.pos(); stream.seek(stringPos); Common::String label; @@ -669,18 +669,18 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) { debugC(2, kDebugLoading, "****** Loading Actions"); uint16 count = stream.readUint16() + 1; - uint16 offset = count * 4 + 2; + uint32 offset = count * 4 + 2; byte id = stream.readByte(); byte subId = stream.readByte(); // I couldn't find how it used in continuity (except print). Frame actionId = 1 byte. - uint16 stringPos = stream.readUint16() + offset; + uint32 stringPos = stream.readUint16() + offset; for (uint16 i = 0; i < count; i++) { uint16 nextId = stream.readByte(); byte nextSubId = stream.readByte(); - uint16 nextStringPos = stream.readUint16() + offset; - uint16 streamPos = stream.pos(); + uint32 nextStringPos = stream.readUint16() + offset; + uint32 streamPos = stream.pos(); stream.seek(stringPos); @@ -1024,7 +1024,7 @@ void Score::loadFontMap(Common::SeekableSubReadStreamEndian &stream) { uint16 count = stream.readUint16(); uint32 offset = (count * 2) + 2; - uint16 currentRawPosition = offset; + uint32 currentRawPosition = offset; for (uint16 i = 0; i < count; i++) { uint16 id = stream.readUint16(); |