Skip to content

Commit

Permalink
DRACI: Move readByte() and readUint32LE() out of assert()
Browse files Browse the repository at this point in the history
  • Loading branch information
Torbjörn Andersson committed Jan 14, 2012
1 parent 6530da3 commit 16f2c5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engines/draci/barchive.cpp
Expand Up @@ -212,7 +212,8 @@ void BArchive::openArchive(const Common::String &path) {

_files[i]._offset = fileOffset; // Offset of file from start

assert(_f.readByte() == 0 &&
byte compressionType = _f.readByte();
assert(compressionType == 0 &&
"Compression type flag is non-zero (file is compressed)");

_files[i]._crc = _f.readByte(); // CRC checksum of the file
Expand All @@ -221,7 +222,8 @@ void BArchive::openArchive(const Common::String &path) {
}

// Last footer item should be equal to footerOffset
assert(reader.readUint32LE() == footerOffset && "Footer offset mismatch");
uint32 footerOffset2 = reader.readUint32LE();
assert(footerOffset2 == footerOffset && "Footer offset mismatch");

// Indicate that the archive has been successfully opened
_opened = true;
Expand Down

0 comments on commit 16f2c5c

Please sign in to comment.