From cbde965110707cc49397a357dddec84c8f38493d Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 9 Mar 2015 11:24:27 +0000 Subject: [PATCH] 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 --- libcurl.c | 2 ++ snd_main.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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)) -- 2.39.2