summaryrefslogtreecommitdiff
path: root/src/qcommon/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/files.c')
-rw-r--r--src/qcommon/files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qcommon/files.c b/src/qcommon/files.c
index 4ebca39a..14db75c7 100644
--- a/src/qcommon/files.c
+++ b/src/qcommon/files.c
@@ -1733,7 +1733,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
@@ -1784,8 +1785,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 );