aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-05 12:52:10 -0500
committerrichiesams2013-08-05 12:52:10 -0500
commit1cff0fb0d6e33f436a998b07037b7a2428de34a8 (patch)
tree7dd282d58b9718097b019d7b51ccef2943a36278 /engines/zvision
parent9bea3cb1c274d2a003ed4e80004fe2a8dc04373f (diff)
downloadscummvm-rg350-1cff0fb0d6e33f436a998b07037b7a2428de34a8.tar.gz
scummvm-rg350-1cff0fb0d6e33f436a998b07037b7a2428de34a8.tar.bz2
scummvm-rg350-1cff0fb0d6e33f436a998b07037b7a2428de34a8.zip
ZVISION: Fix memory free mismatch caused by MemoryReadStream using free()
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/zfs_archive.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/zvision/zfs_archive.cpp b/engines/zvision/zfs_archive.cpp
index f815d9ccd3..3577ce3d14 100644
--- a/engines/zvision/zfs_archive.cpp
+++ b/engines/zvision/zfs_archive.cpp
@@ -138,7 +138,8 @@ Common::SeekableReadStream *ZfsArchive::createReadStreamForMember(const Common::
zfsArchive.open(_fileName);
zfsArchive.seek(entryHeader->offset);
- byte* buffer = new byte[entryHeader->size];
+ // This *HAS* to be malloc (not new[]) because MemoryReadStream uses free() to free the memory
+ byte* buffer = (byte *)malloc(entryHeader->size);
zfsArchive.read(buffer, entryHeader->size);
// Decrypt the data in place
if (_header.xorKey != 0)