mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +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;
|
return NULL;
|
||||||
|
|
||||||
start = strchr (line, ']');
|
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)
|
if (start - line == 9)
|
||||||
milli = 10;
|
milli = 10;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue