vlc/vlc-1.1 | branch: master | Pierre Ynard <[email protected]> | Mon Dec 19 
00:36:07 2011 +0100| [3a260f3dc37945ca04491d54cabd10b21e90ffbf] | committer: 
Pierre Ynard

sap: handle SAP_Add() errors

Fixes #5640

Signed-off-by: RĂ©mi Denis-Courmont <[email protected]>
(cherry picked from commit dbb19bb6848207d5470f229d65d179ffaa3c79b2)

Signed-off-by: Pierre Ynard <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=3a260f3dc37945ca04491d54cabd10b21e90ffbf
---

 src/stream_output/announce.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/stream_output/announce.c b/src/stream_output/announce.c
index 3944705..b307490 100644
--- a/src/stream_output/announce.c
+++ b/src/stream_output/announce.c
@@ -100,7 +100,14 @@ sout_AnnounceRegisterSDP( vlc_object_t *obj, const char 
*psz_sdp,
         goto error;
 
     msg_Dbg (obj, "adding SAP session");
-    SAP_Add (p_sap, p_session );
+    if (SAP_Add (p_sap, p_session))
+    {
+        vlc_mutex_lock (&sap_mutex);
+        vlc_object_release ((vlc_object_t *)p_sap);
+        vlc_mutex_unlock (&sap_mutex);
+        goto error;
+    }
+
     return p_session;
 
 error:

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to