diff options
-rw-r--r-- | engines/kyra/saveload.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index f4fd4668ee..41ba1e5e50 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -60,6 +60,9 @@ KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::Seekab bool saveOk = false; for (uint i = 0; i < ARRAYSIZE(descriptionSize) && !saveOk; ++i) { + if (in->size() < descriptionSize[i] + 6) + continue; + in->seek(0, SEEK_SET); in->read(descriptionBuffer, descriptionSize[i]); descriptionBuffer[descriptionSize[i]] = 0; |