mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
subparse: Check for NULL return of strchr() when parsing LRC subtitles
Thanks to Antonio Morales for finding and reporting the issue. Fixes GHSL-2024-263 Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3892 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8039>
This commit is contained in:
parent
403b10eba0
commit
4c40f73b70
1 changed files with 5 additions and 0 deletions
|
@ -1070,6 +1070,11 @@ parse_lrc (ParserState * state, const gchar * line)
|
|||
return NULL;
|
||||
|
||||
start = strchr (line, ']');
|
||||
// sscanf() does not check for the trailing ] but only up to the last
|
||||
// placeholder, so there might be no ] at the end.
|
||||
if (!start)
|
||||
return NULL;
|
||||
|
||||
if (start - line == 9)
|
||||
milli = 10;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue