summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-11-27 12:20:11 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-27 12:20:11 +0200
commiteef53ef6ed7aad892e4a1fe90a512df1ab0890ff (patch)
treeba969fc5076a80fd2519cecf6fe0c30e45779f3b /ext
parent7488a8fb3544634a1629ce0c804dc3c3ab4314ed (diff)
downloadgstreamer-plugins-bad-eef53ef6ed7aad892e4a1fe90a512df1ab0890ff.tar.gz
dash: Fix stripping of space at the beginning/end of durations
The way how strchr() was called here, it could easily read after the end of the string. Use g_ascii_isspace() instead. Detected by asan in the unit test.
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstmpdparser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index ff303e9b6..898f0fb2b 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -984,11 +984,11 @@ gst_mpdparser_parse_duration (const char *str, guint64 * value)
goto error;
}
/* skip leading/trailing whitespace */
- while (strchr (" \t", str[0])) {
+ while (g_ascii_isspace (str[0])) {
str++;
len--;
}
- while (len > 0 && strchr (" \t", str[len - 1]))
+ while (len > 0 && g_ascii_isspace (str[len - 1]))
--len;
/* read "P" for period */