[vlc-commits] macOS: Fix missing vlc_object_release while getting vouts

David Fuhrmann git at videolan.org
Sun Oct 11 19:38:05 CEST 2020


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Oct 11 19:31:13 2020 +0200| [029933322c5cec3f64b971c9fd3f9b0002508b65] | committer: David Fuhrmann

macOS: Fix missing vlc_object_release while getting vouts

VLC master branch is not affected by this issue anymore.

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

 modules/gui/macosx/helpers.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/helpers.h b/modules/gui/macosx/helpers.h
index d58a761b52..3c6fc44d13 100644
--- a/modules/gui/macosx/helpers.h
+++ b/modules/gui/macosx/helpers.h
@@ -55,10 +55,16 @@ static inline NSArray<NSValue *> *getVouts(void)
     vout_thread_t **pp_vouts;
     size_t i_num_vouts;
 
-    if (!p_input
-        || input_Control(p_input, INPUT_GET_VOUTS, &pp_vouts, &i_num_vouts)
-        || !i_num_vouts)
+    if (!p_input)
+        return nil;
+
+    if (input_Control(p_input, INPUT_GET_VOUTS, &pp_vouts, &i_num_vouts)
+        || !i_num_vouts) {
+        vlc_object_release(p_input);
         return nil;
+    }
+
+    vlc_object_release(p_input);
 
     NSMutableArray<NSValue *> *vouts =
         [NSMutableArray arrayWithCapacity:i_num_vouts];



More information about the vlc-commits mailing list