From 30212e4579e9f811f46cfadc5899c4d21cd513ed Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 19 Dec 2014 15:30:03 +0600 Subject: ZVISION: Fix array compared against 0 (CID 1109648) --- engines/zvision/file/zfs_archive.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/file/zfs_archive.cpp') 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); -- cgit v1.2.3 From 74ea583a4ef446a92cbba4506f7c04513d1ca997 Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Fri, 19 Dec 2014 15:38:28 +0600 Subject: ZVISION: Fix uninitialized scalar field (CID 1109700) --- engines/zvision/file/zfs_archive.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/zvision/file/zfs_archive.cpp') diff --git a/engines/zvision/file/zfs_archive.cpp b/engines/zvision/file/zfs_archive.cpp index 0c076a798b..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"); -- cgit v1.2.3