mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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.
This commit is contained in:
parent
7488a8fb35
commit
eef53ef6ed
1 changed files with 2 additions and 2 deletions
|
@ -984,11 +984,11 @@ gst_mpdparser_parse_duration (const char *str, guint64 * value)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
/* skip leading/trailing whitespace */
|
/* skip leading/trailing whitespace */
|
||||||
while (strchr (" \t", str[0])) {
|
while (g_ascii_isspace (str[0])) {
|
||||||
str++;
|
str++;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
while (len > 0 && strchr (" \t", str[len - 1]))
|
while (len > 0 && g_ascii_isspace (str[len - 1]))
|
||||||
--len;
|
--len;
|
||||||
|
|
||||||
/* read "P" for period */
|
/* read "P" for period */
|
||||||
|
|
Loading…
Reference in a new issue