subparse: don't reset allowed tags

When a discont buffer is processed, the state is re-initialized, which
nullifies the allowed_tags.

The problem is when a subrip string with tags is processed and allowed_tags is
NULL. The function subrip_unescape_formatting() calls g_strjoinv with a
str_array as NULL, leading to a GLib-CRITICAL.

This patch removes the allowed_tags resetting, in parser_state_init(), but
move it into gst_sub_parse_format_autodetect().

https://bugzilla.gnome.org/show_bug.cgi?id=768525
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-07-07 17:37:51 +02:00
parent 7960bc0380
commit c646c62a02

View file

@ -1353,7 +1353,6 @@ parser_state_init (ParserState * state)
state->max_duration = 0; /* no limit */
state->state = 0;
state->segment = NULL;
state->allowed_tags = NULL;
}
static void
@ -1575,6 +1574,7 @@ gst_sub_parse_format_autodetect (GstSubParse * self)
self->parser_type = format;
self->subtitle_codec = gst_sub_parse_get_format_description (format);
parser_state_init (&self->state);
self->state.allowed_tags = NULL;
switch (format) {
case GST_SUB_PARSE_FORMAT_MDVDSUB: