diff options
author | whiterandrek | 2018-06-10 04:22:53 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 10f6e0a6b39a4ad9dc9463c9d1ca08b883c99dd0 (patch) | |
tree | 4581f9b689164a24e42048618895a8b4f3bce0f6 /engines/pink | |
parent | 0659ca4846d6b7eade11628e35c6dad6bf876e49 (diff) | |
download | scummvm-rg350-10f6e0a6b39a4ad9dc9463c9d1ca08b883c99dd0.tar.gz scummvm-rg350-10f6e0a6b39a4ad9dc9463c9d1ca08b883c99dd0.tar.bz2 scummvm-rg350-10f6e0a6b39a4ad9dc9463c9d1ca08b883c99dd0.zip |
PINK: fix loading empty page from save
Diffstat (limited to 'engines/pink')
-rw-r--r-- | engines/pink/objects/pages/game_page.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp index e0d5de1c3c..b2b73453d1 100644 --- a/engines/pink/objects/pages/game_page.cpp +++ b/engines/pink/objects/pages/game_page.cpp @@ -160,9 +160,11 @@ void GamePage::saveStateToMem() { void GamePage::loadState(Archive &archive) { uint size = archive.readDWORD(); - _memFile = new Common::MemoryReadWriteStream(DisposeAfterUse::YES); - for (uint i = 0; i < size; ++i) { - _memFile->writeByte(archive.readByte()); + if (size) { + _memFile = new Common::MemoryReadWriteStream(DisposeAfterUse::YES); + for (uint i = 0; i < size; ++i) { + _memFile->writeByte(archive.readByte()); + } } } |