summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2013-12-19 14:26:34 +0100
committerEdward Hervey <bilboed@bilboed.com>2013-12-19 14:26:34 +0100
commitcdd72905af1f479cf6d3e1e7c01e8842847c18d5 (patch)
tree974511cf701bd8d4a14452cf385a95cc1662c404
parentd3237dc9dc897b1914891463e23335822ee10b2e (diff)
rtsp-stream: Check return value of sscanf
streamid is only valid if sscanf matched something.
-rw-r--r--gst/rtsp-server/rtsp-stream.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c
index 6428150..bcc8ccf 100644
--- a/gst/rtsp-server/rtsp-stream.c
+++ b/gst/rtsp-server/rtsp-stream.c
@@ -421,8 +421,11 @@ gst_rtsp_stream_has_control (GstRTSPStream * stream, const gchar * control)
res = (g_strcmp0 (priv->control, control) == 0);
else {
guint streamid;
- sscanf (control, "stream=%u", &streamid);
- res = (streamid == priv->idx);
+
+ if (sscanf (control, "stream=%u", &streamid) > 0)
+ res = (streamid == priv->idx);
+ else
+ res = FALSE;
}
g_mutex_unlock (&priv->lock);
@@ -1032,10 +1035,6 @@ cleanup:
gst_element_set_state (udpsink0, GST_STATE_NULL);
gst_object_unref (udpsink0);
}
- if (udpsink1) {
- gst_element_set_state (udpsink1, GST_STATE_NULL);
- gst_object_unref (udpsink1);
- }
if (inetaddr)
g_object_unref (inetaddr);
g_list_free_full (rejected_addresses,