mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
rtsp-stream: Check return value of sscanf
streamid is only valid if sscanf matched something.
This commit is contained in:
parent
d3237dc9dc
commit
cdd72905af
1 changed files with 5 additions and 6 deletions
|
@ -421,8 +421,11 @@ gst_rtsp_stream_has_control (GstRTSPStream * stream, const gchar * control)
|
||||||
res = (g_strcmp0 (priv->control, control) == 0);
|
res = (g_strcmp0 (priv->control, control) == 0);
|
||||||
else {
|
else {
|
||||||
guint streamid;
|
guint streamid;
|
||||||
sscanf (control, "stream=%u", &streamid);
|
|
||||||
|
if (sscanf (control, "stream=%u", &streamid) > 0)
|
||||||
res = (streamid == priv->idx);
|
res = (streamid == priv->idx);
|
||||||
|
else
|
||||||
|
res = FALSE;
|
||||||
}
|
}
|
||||||
g_mutex_unlock (&priv->lock);
|
g_mutex_unlock (&priv->lock);
|
||||||
|
|
||||||
|
@ -1032,10 +1035,6 @@ cleanup:
|
||||||
gst_element_set_state (udpsink0, GST_STATE_NULL);
|
gst_element_set_state (udpsink0, GST_STATE_NULL);
|
||||||
gst_object_unref (udpsink0);
|
gst_object_unref (udpsink0);
|
||||||
}
|
}
|
||||||
if (udpsink1) {
|
|
||||||
gst_element_set_state (udpsink1, GST_STATE_NULL);
|
|
||||||
gst_object_unref (udpsink1);
|
|
||||||
}
|
|
||||||
if (inetaddr)
|
if (inetaddr)
|
||||||
g_object_unref (inetaddr);
|
g_object_unref (inetaddr);
|
||||||
g_list_free_full (rejected_addresses,
|
g_list_free_full (rejected_addresses,
|
||||||
|
|
Loading…
Reference in a new issue