diff options
author | Johannes Schickel | 2009-03-15 14:48:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-03-15 14:48:08 +0000 |
commit | 0e8bd97367a450b5f25e82b8fcb0e188d0b607c7 (patch) | |
tree | 18ca5f490bd6e93ec79f236efd8082c65c0d86ae /engines | |
parent | 6ecc3991ed7253a39a9868699a7f872178b1e38a (diff) | |
download | scummvm-rg350-0e8bd97367a450b5f25e82b8fcb0e188d0b607c7.tar.gz scummvm-rg350-0e8bd97367a450b5f25e82b8fcb0e188d0b607c7.tar.bz2 scummvm-rg350-0e8bd97367a450b5f25e82b8fcb0e188d0b607c7.zip |
Fix for loading Kyra1 Amiga PAK files.
svn-id: r39420
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/resource_intern.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 0c2cda893c..5bcf0d9a87 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -143,8 +143,8 @@ bool ResLoaderPak::checkFilename(Common::String filename) const { } bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const { - int32 filesize = stream.size(); - int32 offset = 0; + uint32 filesize = stream.size(); + uint32 offset = 0; bool switchEndian = false; bool firstFile = true; @@ -157,7 +157,7 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist - if (offset < stream.pos() || offset > filesize) + if (offset < (uint32)stream.pos() || offset > filesize) return false; byte c = 0; @@ -212,9 +212,9 @@ struct PlainArchiveListSearch { } // end of anonymous namespace Common::Archive *ResLoaderPak::load(Common::SharedPtr<Common::ArchiveMember> memberFile, Common::SeekableReadStream &stream) const { - int32 filesize = stream.size(); + uint32 filesize = stream.size(); - int32 startoffset = 0, endoffset = 0; + uint32 startoffset = 0, endoffset = 0; bool switchEndian = false; bool firstFile = true; @@ -229,7 +229,7 @@ Common::Archive *ResLoaderPak::load(Common::SharedPtr<Common::ArchiveMember> mem Common::String file; while (!stream.eos()) { // The start offset of a file should never be in the filelist - if (startoffset < stream.pos() || startoffset > filesize) { + if (startoffset < (uint32)stream.pos() || startoffset > filesize) { warning("PAK file '%s' is corrupted", memberFile->getDisplayName().c_str()); return false; } |