aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorMarisa-Chan2014-12-19 15:30:03 +0600
committerMarisa-Chan2014-12-19 15:30:03 +0600
commit30212e4579e9f811f46cfadc5899c4d21cd513ed (patch)
tree4ca140da642a7357c64930bbc3b5e425b6d1a76e /engines/zvision
parentf4fe0b008fa564a59dddfc59af9385fd3cd958d0 (diff)
downloadscummvm-rg350-30212e4579e9f811f46cfadc5899c4d21cd513ed.tar.gz
scummvm-rg350-30212e4579e9f811f46cfadc5899c4d21cd513ed.tar.bz2
scummvm-rg350-30212e4579e9f811f46cfadc5899c4d21cd513ed.zip
ZVISION: Fix array compared against 0 (CID 1109648)
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/file/zfs_archive.cpp2
-rw-r--r--engines/zvision/file/zfs_archive.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/zvision/file/zfs_archive.cpp b/engines/zvision/file/zfs_archive.cpp
index 9b55a366ed..0c076a798b 100644
--- a/engines/zvision/file/zfs_archive.cpp
+++ b/engines/zvision/file/zfs_archive.cpp
@@ -140,7 +140,7 @@ Common::SeekableReadStream *ZfsArchive::createReadStreamForMember(const Common::
byte *buffer = (byte *)malloc(entryHeader->size);
zfsArchive.read(buffer, entryHeader->size);
// Decrypt the data in place
- if (_header.xorKey != 0)
+ if (_header.xorKey[0] + _header.xorKey[1] + _header.xorKey[2] + _header.xorKey[3] != 0)
unXor(buffer, entryHeader->size, _header.xorKey);
return new Common::MemoryReadStream(buffer, entryHeader->size, DisposeAfterUse::YES);
diff --git a/engines/zvision/file/zfs_archive.h b/engines/zvision/file/zfs_archive.h
index 571591a6d1..fe0221416d 100644
--- a/engines/zvision/file/zfs_archive.h
+++ b/engines/zvision/file/zfs_archive.h
@@ -39,7 +39,7 @@ struct ZfsHeader {
uint32 maxNameLength;
uint32 filesPerBlock;
uint32 fileCount;
- byte xorKey[4];
+ uint8 xorKey[4];
uint32 fileSectionOffset;
};