diff options
author | Johannes Schickel | 2010-05-30 12:44:59 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-05-30 12:44:59 +0000 |
commit | d0c79d21e969b0881fb9dfc1d7b204fa74ff2721 (patch) | |
tree | 5395594f309f763de69b530918970665c8009251 /common | |
parent | dbe561c59b61f40459ed2b4602457308e0426269 (diff) | |
download | scummvm-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
Diffstat (limited to 'common')
-rw-r--r-- | common/unzip.cpp | 4 |
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 |