diff options
Diffstat (limited to 'engines/mohawk/livingbooks.cpp')
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 0c5d7c1575..72c24afa38 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -1470,15 +1470,15 @@ void LBItem::readFrom(Common::SeekableSubReadStreamEndian *stream) { error("Item is larger (should end at %d) than stream (size %d)", endPos, stream->size()); while (true) { + if (stream->pos() == endPos) + break; + uint16 dataType = stream->readUint16(); uint16 dataSize = stream->readUint16(); debug(4, "Data type %04x, size %d", dataType, dataSize); readData(dataType, dataSize, stream); - if (stream->pos() == endPos) - break; - if (stream->pos() > endPos) error("Read off the end (at %d) of data (ends at %d)", stream->pos(), endPos); |