]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix a curl-related hang when exiting.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Mar 2015 11:24:27 +0000 (11:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Mar 2015 11:24:27 +0000 (11:24 +0000)
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
snd_main.c

index b228350edfd385f7501ec4d174aed741f5f91773..2f001d5b5d821d79036f0b6086eb1c398d970a7e 100644 (file)
--- 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
index 251084a06fb38a2281c4d09e9a70914d5fb384f2..d54267bdb6d44b7a57b346ea8ed45cba1c2dbd2a 100644 (file)
@@ -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))