mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
sdpdemux: ensure that only one srcpad is created per stream
If two senders use the same multicast IP and port then new_session_pad() may try to add a srcpad to the same stream twice. stream->srcpad is updated but gst_element_add_pad() fails the second time. As a result stream->srcpad points to a deleted object and access in gst_sdp_demux_stream_free() fails with a segfault. Just ignore the second pad. Nothing useful can be done with it anyway. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4873>
This commit is contained in:
parent
94f2a9cb2b
commit
0fe375dc84
1 changed files with 10 additions and 0 deletions
|
@ -536,6 +536,9 @@ new_session_pad (GstElement * session, GstPad * pad, GstSDPDemux * demux)
|
||||||
if (stream == NULL)
|
if (stream == NULL)
|
||||||
goto unknown_stream;
|
goto unknown_stream;
|
||||||
|
|
||||||
|
if (stream->srcpad)
|
||||||
|
goto unexpected_pad;
|
||||||
|
|
||||||
stream->ssrc = ssrc;
|
stream->ssrc = ssrc;
|
||||||
|
|
||||||
/* no need for a timeout anymore now */
|
/* no need for a timeout anymore now */
|
||||||
|
@ -576,6 +579,13 @@ new_session_pad (GstElement * session, GstPad * pad, GstSDPDemux * demux)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
unexpected_pad:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (demux, "ignoring unexpected session pad");
|
||||||
|
GST_SDP_STREAM_UNLOCK (demux);
|
||||||
|
g_free (name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
unknown_stream:
|
unknown_stream:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (demux, "ignoring unknown stream");
|
GST_DEBUG_OBJECT (demux, "ignoring unknown stream");
|
||||||
|
|
Loading…
Reference in a new issue