diff options
author | Johannes Schickel | 2008-02-09 14:43:43 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-02-09 14:43:43 +0000 |
commit | 40b19365be6892024ff2176eb82f547fa23af2c4 (patch) | |
tree | ce2a681c3c5e68c87e3fc248a4057a218be3cb32 /engines/kyra/resource.cpp | |
parent | 166698d29dc267f52e715d0d229b3e082d47718c (diff) | |
download | scummvm-rg350-40b19365be6892024ff2176eb82f547fa23af2c4.tar.gz scummvm-rg350-40b19365be6892024ff2176eb82f547fa23af2c4.tar.bz2 scummvm-rg350-40b19365be6892024ff2176eb82f547fa23af2c4.zip |
Added another check if PAK file is corrupted.
svn-id: r30833
Diffstat (limited to 'engines/kyra/resource.cpp')
-rw-r--r-- | engines/kyra/resource.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index b96b3c00dd..74a858da72 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -415,6 +415,12 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead } while (!stream.eos()) { + // The start offset of a file should never be in the filelist + if (startoffset < stream.pos()) { + warning("PAK file '%s' is corrupted", filename.c_str()); + return false; + } + Common::String file = ""; byte c = 0; |