aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/qcommon/files.c')
-rw-r--r--code/qcommon/files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index 3602f81..a4fa79d 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -1739,7 +1739,8 @@ static pack_t *FS_LoadZipFile( char *zipfile, const char *basename )
buildBuffer = Z_Malloc( (gi.number_entry * sizeof( fileInPack_t )) + len );
namePtr = ((char *) buildBuffer) + gi.number_entry * sizeof( fileInPack_t );
- fs_headerLongs = Z_Malloc( gi.number_entry * sizeof(int) );
+ fs_headerLongs = Z_Malloc( ( gi.number_entry + 1 ) * sizeof(int) );
+ fs_headerLongs[ fs_numHeaderLongs++ ] = LittleLong( fs_checksumFeed );
// get the hash table size from the number of files in the zip
// because lots of custom pk3 files have less than 32 or 64 files
@@ -1790,8 +1791,8 @@ static pack_t *FS_LoadZipFile( char *zipfile, const char *basename )
unzGoToNextFile(uf);
}
- pack->checksum = Com_BlockChecksum( fs_headerLongs, 4 * fs_numHeaderLongs );
- pack->pure_checksum = Com_BlockChecksumKey( fs_headerLongs, 4 * fs_numHeaderLongs, LittleLong(fs_checksumFeed) );
+ pack->checksum = Com_BlockChecksum( &fs_headerLongs[ 1 ], 4 * ( fs_numHeaderLongs - 1 ) );
+ pack->pure_checksum = Com_BlockChecksum( fs_headerLongs, 4 * fs_numHeaderLongs );
pack->checksum = LittleLong( pack->checksum );
pack->pure_checksum = LittleLong( pack->pure_checksum );