dtlssrtpenc: Don't crash if no pad name is provided when requesting a new pad

It is mandatory to provide a valid pad name for dtlssrtpenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7263>
This commit is contained in:
Sebastian Dröge 2024-06-02 10:26:19 +03:00 committed by GStreamer Marge Bot
parent cff4135b04
commit 016a76ecb1

View file

@ -396,6 +396,9 @@ gst_dtls_srtp_enc_request_new_pad (GstElement * element,
g_return_val_if_fail (templ->direction == GST_PAD_SINK, NULL); g_return_val_if_fail (templ->direction == GST_PAD_SINK, NULL);
g_return_val_if_fail (self->srtp_enc, NULL); g_return_val_if_fail (self->srtp_enc, NULL);
if (name == NULL)
return NULL;
if (templ == gst_element_class_get_pad_template (klass, "rtp_sink_%d")) { if (templ == gst_element_class_get_pad_template (klass, "rtp_sink_%d")) {
gchar *clocksync_name; gchar *clocksync_name;
GstElement *clocksync; GstElement *clocksync;