mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
subparse: Don't read beyond array
If num_open_tags is 0, we shouldn't try to get the "last" open tag since there isn't any.
This commit is contained in:
parent
63e8900c47
commit
3ac37bbe67
1 changed files with 3 additions and 1 deletions
|
@ -816,7 +816,9 @@ subrip_fix_up_markup (gchar ** p_txt, gconstpointer allowed_tags_ptr)
|
|||
if (*next_tag == '<' && *(next_tag + 1) == '/') {
|
||||
end_tag = strchr (cur, '>');
|
||||
if (end_tag) {
|
||||
const gchar *last = g_ptr_array_index (open_tags, num_open_tags - 1);
|
||||
const gchar *last = NULL;
|
||||
if (num_open_tags > 0)
|
||||
last = g_ptr_array_index (open_tags, num_open_tags - 1);
|
||||
if (num_open_tags == 0
|
||||
|| g_ascii_strncasecmp (end_tag - 1, last, strlen (last))) {
|
||||
GST_LOG ("broken input, closing tag '%s' is not open", end_tag - 1);
|
||||
|
|
Loading…
Reference in a new issue