diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 35bd8c6cb8..17967b3283 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2811,6 +2811,11 @@ request_rtp_decoder (GstElement * rtpbin, guint session, GstRTSPStream * stream) stream->srtpdec = gst_element_factory_make ("srtpdec", name); g_free (name); + if (stream->srtpdec == NULL) { + GST_ELEMENT_ERROR (stream->parent, CORE, MISSING_PLUGIN, (NULL), + ("no srtpdec element present!")); + return NULL; + } g_signal_connect (stream->srtpdec, "request-key", (GCallback) request_key, stream); } @@ -2839,6 +2844,12 @@ request_rtcp_encoder (GstElement * rtpbin, guint session, stream->srtpenc = gst_element_factory_make ("srtpenc", name); g_free (name); + if (stream->srtpenc == NULL) { + GST_ELEMENT_ERROR (stream->parent, CORE, MISSING_PLUGIN, (NULL), + ("no srtpenc element present!")); + return NULL; + } + /* get RTCP crypto parameters from caps */ s = gst_caps_get_structure (stream->srtcpparams, 0); if (s) {