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

Pierre Ynard git at videolan.org
Tue Dec 20 00:23:47 CET 2011


vlc/vlc-1.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Dec 19 00:36:07 2011 +0100| [4308309a068d645446770731e4fd54b35048b78b] | committer: Jean-Baptiste Kempf

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: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=4308309a068d645446770731e4fd54b35048b78b
---

 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 95dd81a..e7f39e7 100644
--- a/src/stream_output/announce.c
+++ b/src/stream_output/announce.c
@@ -92,7 +92,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