diff options
author | Lars Skovlund | 2010-11-08 11:02:43 +0000 |
---|---|---|
committer | Lars Skovlund | 2010-11-08 11:02:43 +0000 |
commit | 416025cda90f23ea5b94c88dcea0c202df279223 (patch) | |
tree | 5d1be4391f595b173ba38e27fa483e0406fb4289 | |
parent | f0fe060cc3a17f6bcb5e9253fbce0605a88cc0c2 (diff) | |
download | scummvm-rg350-416025cda90f23ea5b94c88dcea0c202df279223.tar.gz scummvm-rg350-416025cda90f23ea5b94c88dcea0c202df279223.tar.bz2 scummvm-rg350-416025cda90f23ea5b94c88dcea0c202df279223.zip |
Fix assertion failure in SCI0 saving code
svn-id: r54138
-rw-r--r-- | engines/sci/engine/savegame.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 072c4db57b..3ced5a4f9d 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -411,15 +411,19 @@ void Script::syncStringHeap(Common::Serializer &s) { do { int blockType = READ_LE_UINT16(buf); - int blockSize = READ_LE_UINT16(buf + 2); - assert(blockSize > 0); - + int blockSize; if (blockType == 0) break; + + blockSize = READ_LE_UINT16(buf + 2); + assert(blockSize > 0); + + if (blockType == SCI_OBJ_STRINGS) s.syncBytes(buf, blockSize); buf += blockSize; + if (_buf - buf == 0) break; } while (1); |