[vlc-devel] commit: macosx: Use pl_CurrentInput properly, and make sure we don' t dereference NULL. (Pierre d'Herbemont )
git version control
git at videolan.org
Wed Aug 26 18:28:46 CEST 2009
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Wed Aug 26 15:45:09 2009 +0200| [7b51aa6a19a0a8a834668365f77c1625f83c61d8] | committer: Pierre d'Herbemont
macosx: Use pl_CurrentInput properly, and make sure we don't dereference NULL.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b51aa6a19a0a8a834668365f77c1625f83c61d8
---
modules/gui/macosx/intf.m | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index cd7ef65..5d98ed2 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -284,8 +284,9 @@ bool checkProgressPanel (void *priv)
input_thread_t *getInput(void)
{
intf_thread_t *p_intf = VLCIntf;
- playlist_t *p_playlist = pl_Hold(p_intf);
- input_thread_t *p_input = pl_CurrentInput(p_playlist);
+ if (!p_intf)
+ return NULL;
+ input_thread_t *p_input = pl_CurrentInput(p_intf);
pl_Release(p_playlist);
return p_input;
}
@@ -293,6 +294,8 @@ input_thread_t *getInput(void)
vout_thread_t *getVout(void)
{
input_thread_t *p_input = getInput();
+ if (!p_input)
+ return NULL;
vout_thread_t *p_vout = input_GetVout(p_input);
vlc_object_release(p_input);
return p_vout;
@@ -301,6 +304,8 @@ vout_thread_t *getVout(void)
aout_instance_t *getAout(void)
{
input_thread_t *p_input = getInput();
+ if (!p_input)
+ return NULL;
aout_instance_t *p_aout = input_GetAout(p_input);
vlc_object_release(p_input);
return p_aout;
More information about the vlc-devel
mailing list