projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7488a8f
)
dash: Fix stripping of space at the beginning/end of durations
author
Sebastian Dröge
<sebastian@centricular.com>
Sun, 27 Nov 2016 10:20:11 +0000
(12:20 +0200)
committer
Sebastian Dröge
<sebastian@centricular.com>
Sun, 27 Nov 2016 10:20:11 +0000
(12:20 +0200)
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.
ext/dash/gstmpdparser.c
patch
|
blob
|
history
diff --git
a/ext/dash/gstmpdparser.c
b/ext/dash/gstmpdparser.c
index
ff303e9
..
898f0fb
100644
(file)
--- 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 */