[vlc-commits] ActiveX: fixed crash on play of nonexistent playlist

Sergey Radionov git at videolan.org
Tue Nov 8 02:23:38 CET 2011


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Mon Aug  1 10:26:47 2011 +0700| [af7a6ced5189335eb0a8b653fbc3908fbe9b7c26] | committer: Jean-Baptiste Kempf

ActiveX: fixed crash on play of nonexistent playlist

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 activex/plugin.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 5d53a40..2486461 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -1214,6 +1214,16 @@ static void handle_pausable_changed_event(const libvlc_event_t* event, void *par
 
 bool VLCPlugin::playlist_select( int idx )
 {
+    //In some cases, libvlc may not have been initialized yet.
+    //So check it and initialize if needed (in getVLC())
+    libvlc_instance_t* p_libvlc;
+    HRESULT hr = getVLC(&p_libvlc);
+    if( FAILED(hr) || !p_libvlc)
+        return false;
+
+    if(!_p_mlist)
+        return false;//playlist does not exist, nothing to play...
+
     libvlc_media_t *p_m = NULL;
 
     assert(_p_mlist);



More information about the vlc-commits mailing list