From: divverent Date: Mon, 9 Mar 2015 11:24:27 +0000 (+0000) Subject: Fix a curl-related hang when exiting. X-Git-Tag: xonotic-v0.8.5~88^2~117 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=cbde965110707cc49397a357dddec84c8f38493d Fix a curl-related hang when exiting. Fix a NULL crash when creating a sound without a worldmodel (harmless NULL, but exploitable by svc_disconnect svc_sound in a single packet). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12204 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/libcurl.c b/libcurl.c index b228350e..2f001d5b 100644 --- a/libcurl.c +++ b/libcurl.c @@ -980,6 +980,7 @@ static qboolean Curl_Begin(const char *URL, const char *extraheaders, double max ++numdownloads_added; } + if (curl_mutex) Thread_UnlockMutex(curl_mutex); return false; } } @@ -1003,6 +1004,7 @@ static qboolean Curl_Begin(const char *URL, const char *extraheaders, double max } } + if (curl_mutex) Thread_UnlockMutex(curl_mutex); return false; } else diff --git a/snd_main.c b/snd_main.c index 251084a0..d54267bd 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1493,7 +1493,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx) if (snd_spatialization_occlusion.integer) { if(snd_spatialization_occlusion.integer & 1) - if(listener_pvs) + if(listener_pvs && cl.worldmodel) { int cluster = cl.worldmodel->brush.PointInLeaf(cl.worldmodel, ch->origin)->clusterindex; if(cluster >= 0 && cluster < 8 * listener_pvsbytes && !CHECKPVSBIT(listener_pvs, cluster))