rtspclientsink: Check return value of sscanf

And just make sure we always have 0/0 if we have an error

CID #1352031
This commit is contained in:
Edward Hervey 2016-03-07 14:48:38 +01:00
parent fe5f8077c1
commit 2639fbdb7f

View file

@ -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;
}