[vlc-devel] commit: More cases were p_md was not checked in Mozilla toolbar code. ( Jean-Paul Saman )

git version control git at videolan.org
Tue Mar 4 22:11:38 CET 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Tue Mar  4 22:09:21 2008 +0100| [fae5455b0b21b0eb52ed29cb8c2bc27861593186]

More cases were p_md was not checked in Mozilla toolbar code.

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

 projects/mozilla/vlcshell.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/projects/mozilla/vlcshell.cpp b/projects/mozilla/vlcshell.cpp
index 2ed67a4..13e93ad 100644
--- a/projects/mozilla/vlcshell.cpp
+++ b/projects/mozilla/vlcshell.cpp
@@ -820,7 +820,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
                 libvlc_exception_clear( &ex );
 
                 f_length = (float)f_length *
-                        ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
+                           ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
 
                 libvlc_exception_init( &ex );
                 libvlc_media_instance_set_time( p_md, f_length, &ex );
@@ -860,7 +860,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             i_playing = libvlc_playlist_isplaying( p_plugin->getVLC(), &ex );
             libvlc_exception_clear( &ex );
 
-            if( i_playing == 1 )
+            if( (i_playing == 1) && p_md )
             {
                 libvlc_exception_init( &ex );
                 libvlc_set_fullscreen( p_md, 1, &ex );
@@ -875,7 +875,8 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             libvlc_audio_toggle_mute( p_plugin->getVLC(), &ex );
             libvlc_exception_clear( &ex );
         }
-        libvlc_media_instance_release( p_md );
+        
+        if( p_md ) libvlc_media_instance_release( p_md );
     }
     Redraw( w, closure, event );
 }




More information about the vlc-devel mailing list