[vlc-commits] vout: fix leak if vlc_clone fails

Thomas Guillem git at videolan.org
Tue Apr 2 16:02:23 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Apr  2 15:48:18 2019 +0200| [e7cce38999c6db5e1d787db254a421c1de8ffb8e] | committer: Thomas Guillem

vout: fix leak if vlc_clone fails

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7cce38999c6db5e1d787db254a421c1de8ffb8e
---

 src/video_output/video_output.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index c5a50a26c1..3ae0694774 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1877,8 +1877,10 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
 
     vlc_mutex_unlock(&sys->window_lock);
 
-    if (vout_Start(vout, cfg)
-     || vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
+    if (vout_Start(vout, cfg))
+        goto error;
+    if (vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) {
+        vout_Stop(vout);
 error:
         msg_Err(vout, "video output creation failed");
         video_format_Clean(&sys->original);



More information about the vlc-commits mailing list