diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-11-19 16:13:56 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-11-19 16:13:56 +0100 |
commit | 02a5940a45182983c9ebf32b189bf52bd6696458 (patch) | |
tree | 22318c4d5feab80d5cf5cd2e85ef8c1f2f4e4214 /gst-libs | |
parent | 84b1ee4987926fe2dbca2c298870b43a38246ecd (diff) |
range: handle parse errors better
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/rtsp/gstrtsprange.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gst-libs/gst/rtsp/gstrtsprange.c b/gst-libs/gst/rtsp/gstrtsprange.c index d77965cb9..76701fa5d 100644 --- a/gst-libs/gst/rtsp/gstrtsprange.c +++ b/gst-libs/gst/rtsp/gstrtsprange.c @@ -89,10 +89,13 @@ parse_npt_time (const gchar * str, GstRTSPTime * time) if (sscanf (str, "%2d:%2d:", &hours, &mins) != 2) return GST_RTSP_EINVAL; - str = strchr (str, ':') + 1; - str = strchr (str, ':') + 1; + str = strchr (str, ':'); + str = strchr (str + 1, ':'); + if (str == NULL) + return GST_RTSP_EINVAL; + time->type = GST_RTSP_TIME_SECONDS; - time->seconds = ((hours * 60) + mins) * 60 + gst_strtod (str); + time->seconds = ((hours * 60) + mins) * 60 + gst_strtod (str + 1); } else { time->type = GST_RTSP_TIME_SECONDS; time->seconds = gst_strtod (str); |