sdpdemux: ensure that only one srcpad is created per stream
authorMichael Olbrich <m.olbrich@pengutronix.de>
Thu, 11 May 2023 13:28:35 +0000 (15:28 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 16 Jun 2023 01:53:12 +0000 (01:53 +0000)
commit0fe375dc84eed5f1d597623f5a1b0aa24cb723e9
tree445916d80d66c7bc0cd2d6f87239943eda0ba499
parent94f2a9cb2b19d7f6187e80522b495b1be5c929cf
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>
subprojects/gst-plugins-bad/gst/sdp/gstsdpdemux.c