diff options
Diffstat (limited to 'engines/zvision/file/zfs_archive.cpp')
-rw-r--r-- | engines/zvision/file/zfs_archive.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/zvision/file/zfs_archive.cpp b/engines/zvision/file/zfs_archive.cpp index 9b55a366ed..3a385cd8fd 100644 --- a/engines/zvision/file/zfs_archive.cpp +++ b/engines/zvision/file/zfs_archive.cpp @@ -31,6 +31,7 @@ namespace ZVision { ZfsArchive::ZfsArchive(const Common::String &fileName) : _fileName(fileName) { Common::File zfsFile; + memset(&_header, 0, sizeof(_header)); if (!zfsFile.open(_fileName)) { warning("ZFSArchive::ZFSArchive(): Could not find the archive file"); @@ -140,7 +141,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); |