diff options
author | Willem Jan Palenstijn | 2008-09-15 19:34:06 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2008-09-15 19:34:06 +0000 |
commit | 395536be6eae566be714bd55d6bc4eb79a9a30aa (patch) | |
tree | a67c891796c61a95b532a746727b16200d63f531 | |
parent | eef9a003ba1dc693ba4b9172b0903f12d2bc77ea (diff) | |
download | scummvm-rg350-395536be6eae566be714bd55d6bc4eb79a9a30aa.tar.gz scummvm-rg350-395536be6eae566be714bd55d6bc4eb79a9a30aa.tar.bz2 scummvm-rg350-395536be6eae566be714bd55d6bc4eb79a9a30aa.zip |
also check for premature end-of-stream when loading
svn-id: r34563
-rw-r--r-- | engines/kyra/saveload_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/saveload_lok.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/saveload_mr.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index dc7d944cda..be7a74e1c3 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -279,7 +279,7 @@ void KyraEngine_HoF::loadGame(const char *fileName) { _sceneExit3 = in.readUint16(); _sceneExit4 = in.readUint16(); - if (saveFile->err()) + if (saveFile->err() || saveFile->eos()) error("Load failed ('%s', '%s').", fileName, header.description.c_str()); else debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str()); diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index 8be5e102cf..f0d9f1ba82 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -206,7 +206,7 @@ void KyraEngine_LoK::loadGame(const char *fileName) { _mousePressFlag = false; setMousePos(brandonX, brandonY); - if (in->err()) + if (in->err() || in->eos()) error("Load failed ('%s', '%s').", fileName, header.description.c_str()); else debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str()); diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp index 07ca5c31f5..0db82863ab 100644 --- a/engines/kyra/saveload_mr.cpp +++ b/engines/kyra/saveload_mr.cpp @@ -283,7 +283,7 @@ void KyraEngine_MR::loadGame(const char *fileName) { _sceneExit3 = in.readUint16(); _sceneExit4 = in.readUint16(); - if (saveFile->err()) + if (saveFile->err() || saveFile->eos()) error("Load failed ('%s', '%s').", fileName, header.description.c_str()); else debugC(1, kDebugLevelMain, "Loaded savegame '%s.'", header.description.c_str()); |