mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
subparse: fix some leaks
Fixes check-valgrind for subparse test.
This commit is contained in:
parent
ffa9f04bb2
commit
92786741df
1 changed files with 21 additions and 2 deletions
|
@ -707,6 +707,8 @@ subrip_unescape_formatting (gchar * txt, gconstpointer allowed_tags_ptr,
|
||||||
g_free (res);
|
g_free (res);
|
||||||
g_free (search_pattern);
|
g_free (search_pattern);
|
||||||
g_free (allowed_tags_pattern);
|
g_free (allowed_tags_pattern);
|
||||||
|
|
||||||
|
g_regex_unref (tag_regex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -925,6 +927,7 @@ parse_webvtt_cue_settings (ParserState * state, const gchar * settings)
|
||||||
case 'D':
|
case 'D':
|
||||||
if (strlen (splitted_settings[i]) > 2) {
|
if (strlen (splitted_settings[i]) > 2) {
|
||||||
vertical_found = TRUE;
|
vertical_found = TRUE;
|
||||||
|
g_free (state->vertical);
|
||||||
state->vertical = g_strdup (splitted_settings[i] + 2);
|
state->vertical = g_strdup (splitted_settings[i] + 2);
|
||||||
valid_tag = TRUE;
|
valid_tag = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -953,6 +956,7 @@ parse_webvtt_cue_settings (ParserState * state, const gchar * settings)
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
if (strlen (splitted_settings[i]) > 2) {
|
if (strlen (splitted_settings[i]) > 2) {
|
||||||
|
g_free (state->alignment);
|
||||||
state->alignment = g_strdup (splitted_settings[i] + 2);
|
state->alignment = g_strdup (splitted_settings[i] + 2);
|
||||||
alignment_found = TRUE;
|
alignment_found = TRUE;
|
||||||
valid_tag = TRUE;
|
valid_tag = TRUE;
|
||||||
|
@ -968,11 +972,15 @@ parse_webvtt_cue_settings (ParserState * state, const gchar * settings)
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
g_strfreev (splitted_settings);
|
g_strfreev (splitted_settings);
|
||||||
if (!vertical_found)
|
if (!vertical_found) {
|
||||||
|
g_free (state->vertical);
|
||||||
state->vertical = g_strdup ("");
|
state->vertical = g_strdup ("");
|
||||||
if (!alignment_found)
|
}
|
||||||
|
if (!alignment_found) {
|
||||||
|
g_free (state->alignment);
|
||||||
state->alignment = g_strdup ("");
|
state->alignment = g_strdup ("");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
parse_subrip (ParserState * state, const gchar * line)
|
parse_subrip (ParserState * state, const gchar * line)
|
||||||
|
@ -1122,7 +1130,9 @@ parse_webvtt (ParserState * state, const gchar * line)
|
||||||
if (cue_settings)
|
if (cue_settings)
|
||||||
parse_webvtt_cue_settings (state, cue_settings + 1);
|
parse_webvtt_cue_settings (state, cue_settings + 1);
|
||||||
else {
|
else {
|
||||||
|
g_free (state->vertical);
|
||||||
state->vertical = g_strdup ("");
|
state->vertical = g_strdup ("");
|
||||||
|
g_free (state->alignment);
|
||||||
state->alignment = g_strdup ("");
|
state->alignment = g_strdup ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1362,6 +1372,12 @@ parser_state_dispose (GstSubParse * self, ParserState * state)
|
||||||
g_string_free (state->buf, TRUE);
|
g_string_free (state->buf, TRUE);
|
||||||
state->buf = NULL;
|
state->buf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (state->vertical);
|
||||||
|
state->vertical = NULL;
|
||||||
|
g_free (state->alignment);
|
||||||
|
state->alignment = NULL;
|
||||||
|
|
||||||
if (state->user_data) {
|
if (state->user_data) {
|
||||||
switch (self->parser_type) {
|
switch (self->parser_type) {
|
||||||
case GST_SUB_PARSE_FORMAT_QTTEXT:
|
case GST_SUB_PARSE_FORMAT_QTTEXT:
|
||||||
|
@ -1781,7 +1797,10 @@ handle_buffer (GstSubParse * self, GstBuffer * buf)
|
||||||
GST_TIME_ARGS (self->state.duration));
|
GST_TIME_ARGS (self->state.duration));
|
||||||
|
|
||||||
g_free (self->state.vertical);
|
g_free (self->state.vertical);
|
||||||
|
self->state.vertical = NULL;
|
||||||
g_free (self->state.alignment);
|
g_free (self->state.alignment);
|
||||||
|
self->state.alignment = NULL;
|
||||||
|
|
||||||
ret = gst_pad_push (self->srcpad, buf);
|
ret = gst_pad_push (self->srcpad, buf);
|
||||||
|
|
||||||
/* move this forward (the tmplayer parser needs this) */
|
/* move this forward (the tmplayer parser needs this) */
|
||||||
|
|
Loading…
Reference in a new issue