diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c index a822d956b9..40ca87ace3 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1676,6 +1676,9 @@ read_bytes (GstRTSPConnection * conn, guint8 * buffer, guint * idx, guint size, if (G_UNLIKELY (*idx > size)) return GST_RTSP_ERROR; + if (G_UNLIKELY (!conn->input_stream)) + return GST_RTSP_EINVAL; + left = size - *idx; while (left) { @@ -1694,6 +1697,9 @@ error: if (G_UNLIKELY (r == 0)) return GST_RTSP_EEOF; + if (G_UNLIKELY (!err)) + return GST_RTSP_EINVAL; + GST_DEBUG ("%s", err->message); res = gst_rtsp_result_from_g_io_error (err, GST_RTSP_ESYS); g_clear_error (&err);