diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 76b98e22a7..9f806ec83d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1108,10 +1108,8 @@ gst_rtspsrc_set_property (GObject * object, guint prop_id, const GValue * value, const gchar *str; str = g_value_get_string (value); - if (str) { - sscanf (str, "%u-%u", - &rtspsrc->client_port_range.min, &rtspsrc->client_port_range.max); - } else { + if (sscanf (str, "%u-%u", &rtspsrc->client_port_range.min, + &rtspsrc->client_port_range.max) != 2) { rtspsrc->client_port_range.min = 0; rtspsrc->client_port_range.max = 0; }