From c646c62a025a3c44a4b58d3553bb599ed295af25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 7 Jul 2016 17:37:51 +0200 Subject: [PATCH] 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 --- gst/subparse/gstsubparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index c8acc0650..ef23addfc 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -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: -- 2.34.1