Skip to content

Commit

Permalink
KYRA: Silence some valgrind warnings by doing a slight sanity check o…
Browse files Browse the repository at this point in the history
…n savefile size.
  • Loading branch information
Johannes Schickel committed Dec 28, 2011
1 parent 5492307 commit ae8ab8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engines/kyra/saveload.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit ae8ab8d

Please sign in to comment.