[vlc-devel] [PATCH] sout/standard: create_SDP: fix inverted logic

Filip Roséen filip at atch.se
Mon Feb 27 07:03:13 CET 2017


sdp.ptr is only of relevance to us if vlc_memstream_close is
successful, on error the pointer is already handled by the function
(and shall have no meaning to us as its content is not defined).

CID: #1401546
---
 modules/stream_out/standard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index 572741f33a..d835e6fc4f 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -184,7 +184,7 @@ static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
         vlc_memstream_printf(&sdp, "m=video %d udp mpeg\r\n", dport);
 
         /* Register the SDP with the SAP thread */
-        if (vlc_memstream_close(&sdp))
+        if (vlc_memstream_close(&sdp) == 0)
         {
             msg_Dbg(p_stream, "Generated SDP:\n%s", sdp.ptr);
             p_sys->p_session =
-- 
2.11.1



More information about the vlc-devel mailing list