[vlc-commits] sap: handle SAP_Add() errors

Pierre Ynard git at videolan.org
Wed Dec 21 22:40:01 CET 2011


vlc/vlc-1.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | 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 <remi at remlab.net>
(cherry picked from commit dbb19bb6848207d5470f229d65d179ffaa3c79b2)

Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> 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:



More information about the vlc-commits mailing list