[vlc-commits] vout: fix invalid clean in error path
Thomas Guillem
git at videolan.org
Wed Dec 4 14:41:56 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Dec 2 17:25:16 2019 +0100| [bf2144ca7abb0a041a9469321022b66fb8ad155f] | committer: Thomas Guillem
vout: fix invalid clean in error path
Prerender mutexes, conditions and formats must be initialized before the first
possible spu_Cleanup().
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bf2144ca7abb0a041a9469321022b66fb8ad155f
---
src/video_output/vout_subpictures.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 0a367c9bed..76fec39d47 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1684,6 +1684,16 @@ spu_t *spu_Create(vlc_object_t *object, vout_thread_t *vout)
sys->source_chain = filter_chain_NewSPU(spu, "sub source");
sys->filter_chain = filter_chain_NewSPU(spu, "sub filter");
+ vlc_mutex_init(&sys->prerender.lock);
+ vlc_cond_init(&sys->prerender.cond);
+ vlc_cond_init(&sys->prerender.output_cond);
+ vlc_vector_init(&sys->prerender.vector);
+ video_format_Init(&sys->prerender.fmtdst, 0);
+ video_format_Init(&sys->prerender.fmtsrc, 0);
+ sys->prerender.p_processed = NULL;
+ sys->prerender.chroma_list[0] = 0;
+ sys->prerender.chroma_list[SPU_CHROMALIST_COUNT] = 0;
+
/* Load text and scale module */
sys->text = SpuRenderCreateAndLoadText(spu);
vlc_mutex_init(&sys->textlock);
@@ -1711,15 +1721,6 @@ spu_t *spu_Create(vlc_object_t *object, vout_thread_t *vout)
sys->last_sort_date = -1;
sys->vout = vout;
- vlc_mutex_init(&sys->prerender.lock);
- vlc_cond_init(&sys->prerender.cond);
- vlc_cond_init(&sys->prerender.output_cond);
- vlc_vector_init(&sys->prerender.vector);
- video_format_Init(&sys->prerender.fmtdst, 0);
- video_format_Init(&sys->prerender.fmtsrc, 0);
- sys->prerender.p_processed = NULL;
- sys->prerender.chroma_list[0] = 0;
- sys->prerender.chroma_list[SPU_CHROMALIST_COUNT] = 0;
if(vlc_clone(&sys->prerender.thread, spu_PrerenderThread, spu, VLC_THREAD_PRIORITY_VIDEO))
{
spu_Cleanup(spu);
More information about the vlc-commits
mailing list