From e29dcb4125e17d3bbf0860361d77e141ddb69b12 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 13 Jan 2022 16:44:45 +0300 Subject: [PATCH] engine: filesystem: accept ZIP files with zip extension, do not assert with NULL free in Zip_Close --- engine/common/filesystem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/common/filesystem.c b/engine/common/filesystem.c index e3c3e402..826430f4 100644 --- a/engine/common/filesystem.c +++ b/engine/common/filesystem.c @@ -928,7 +928,8 @@ void Zip_Close( zip_t *zip ) if( !zip ) return; - Mem_Free( zip->files ); + if( zip->files ) + Mem_Free( zip->files ); FS_EnsureOpenZip( NULL ); @@ -1209,7 +1210,7 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int if( already_loaded ) *already_loaded = false; - if( !Q_stricmp( ext, "pk3" ) ) + if( !Q_stricmp( ext, "pk3" ) || !Q_stricmp( ext, "zip" )) zip = FS_LoadZip( zipfile, &errorcode ); if( zip )