diff options
author | Edward Hervey <bilboed@bilboed.com> | 2016-03-07 14:48:38 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2016-04-29 11:45:19 +0200 |
commit | 2639fbdb7fa8894eb1c1a0c0f0ddde3e4d2c95b0 (patch) | |
tree | 33477fb787a48445bd5a121d53586c46d0d47999 | |
parent | fe5f8077c1523206147c746cc40364ea16da669f (diff) |
rtspclientsink: Check return value of sscanf
And just make sure we always have 0/0 if we have an error
CID #1352031
-rw-r--r-- | gst/rtsp-sink/gstrtspclientsink.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gst/rtsp-sink/gstrtspclientsink.c b/gst/rtsp-sink/gstrtspclientsink.c index 63cdbc3..cc3aa96 100644 --- a/gst/rtsp-sink/gstrtspclientsink.c +++ b/gst/rtsp-sink/gstrtspclientsink.c @@ -1345,11 +1345,9 @@ gst_rtsp_client_sink_set_property (GObject * object, guint prop_id, const gchar *str; str = g_value_get_string (value); - if (str) { - sscanf (str, "%u-%u", - &rtsp_client_sink->client_port_range.min, - &rtsp_client_sink->client_port_range.max); - } else { + if (!str || !sscanf (str, "%u-%u", + &rtsp_client_sink->client_port_range.min, + &rtsp_client_sink->client_port_range.max)) { rtsp_client_sink->client_port_range.min = 0; rtsp_client_sink->client_port_range.max = 0; } |