aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-05-30 12:44:59 +0000
committerJohannes Schickel2010-05-30 12:44:59 +0000
commitd0c79d21e969b0881fb9dfc1d7b204fa74ff2721 (patch)
tree5395594f309f763de69b530918970665c8009251
parentdbe561c59b61f40459ed2b4602457308e0426269 (diff)
downloadscummvm-rg350-d0c79d21e969b0881fb9dfc1d7b204fa74ff2721.tar.gz
scummvm-rg350-d0c79d21e969b0881fb9dfc1d7b204fa74ff2721.tar.bz2
scummvm-rg350-d0c79d21e969b0881fb9dfc1d7b204fa74ff2721.zip
Fix file length of zip file members inside ZipArchive (thanks to fuzzie for reporting).
svn-id: r49321
-rw-r--r--common/unzip.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp
index a83f70d671..e46106025e 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -1433,11 +1433,11 @@ Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::
unz_file_info fileInfo;
unzOpenCurrentFile(_zipFile);
unzGetCurrentFileInfo(_zipFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
- byte *buffer = (byte *)calloc(fileInfo.uncompressed_size+1, 1);
+ byte *buffer = (byte *)malloc(fileInfo.uncompressed_size);
assert(buffer);
unzReadCurrentFile(_zipFile, buffer, fileInfo.uncompressed_size);
unzCloseCurrentFile(_zipFile);
- return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size+1, DisposeAfterUse::YES);
+ return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size, DisposeAfterUse::YES);
// FIXME: instead of reading all into a memory stream, we could
// instead create a new ZipStream class. But then we have to be