Commit 1651d75c authored by Hannes Domani's avatar Hannes Domani Committed by Rémi Denis-Courmont

vout: fix memory leaks

In combination with the previous patch all crashes (double free()) are solved.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 25cb7da5
......@@ -133,6 +133,9 @@ static void vout_display_Delete(vout_display_t *vd)
if (vd->module)
module_unneed(vd, vd->module);
video_format_Clean(&vd->source);
video_format_Clean(&vd->fmt);
vlc_object_release(vd);
}
......@@ -467,19 +470,20 @@ static void VoutDisplayCreateRender(vout_display_t *vd)
es_format_InitFromVideo(&src, &v_src);
/* */
es_format_t dst;
filter_t *filter;
for (int i = 0; i < 1 + (v_dst_cmp.i_chroma != v_dst.i_chroma); i++) {
es_format_t dst;
es_format_InitFromVideo(&dst, i == 0 ? &v_dst : &v_dst_cmp);
filter_chain_Reset(osys->filters, &src, &dst);
filter = filter_chain_AppendFilter(osys->filters,
NULL, NULL, &src, &dst);
es_format_Clean(&dst);
if (filter)
break;
}
es_format_Clean(&src);
if (!filter)
msg_Err(vd, "Failed to adapt decoder format to display");
}
......
......@@ -795,6 +795,8 @@ static void ThreadChangeFilters(vout_thread_t *vout,
}
}
es_format_Clean(&fmt_target);
if (vout->p->filter.configuration != filters) {
free(vout->p->filter.configuration);
vout->p->filter.configuration = filters ? strdup(filters) : NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment